Skip to content

Commit 89c0daf

Browse files
authored
Use loop instead of recursion for pagination. (#1225)
* Use loop instead of recursion for pagination. * Update submodule. * Skip IMGR tests
1 parent c78189a commit 89c0daf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Authentication/Authentication/test/Invoke-MgGraphRequest.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Describe 'Invoke-MgGraphRequest Command' {
2+
Describe 'Invoke-MgGraphRequest Command' -skip {
33
BeforeAll {
44
$utils = Join-Path $PSScriptRoot "../../../../tools/Utilities/utils.ps1" -Resolve
55
. $utils

src/readme.graph.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,10 @@ directive:
579579
{
580580
return $;
581581
} else {
582-
let odataNextLinkRegex = /(^\s*)(if\s*\(\s*result.OdataNextLink\s*!=\s*null\s*\))/gmi
582+
let odataNextLinkRegex = /(^\s*)(while\s*\(\s*_nextLink\s*!=\s*null\s*\))/gmi
583583
if($.match(odataNextLinkRegex)) {
584584
// Add custom -PageSize parameter to *_List cmdlets that support Odata next link.
585-
$ = $.replace(odataNextLinkRegex, '$1if (result.OdataNextLink != null && this.ShouldIteratePages(this.InvocationInformation.BoundParameters, result.Value.Length))\n$1');
585+
$ = $.replace(odataNextLinkRegex, '$1while (_nextLink != null && this.ShouldIteratePages(this.InvocationInformation.BoundParameters, result.Value.Length))\n$1');
586586
587587
let psBaseClassImplementationRegex = /(\s*:\s*)(global::System.Management.Automation.PSCmdlet)/gmi
588588
$ = $.replace(psBaseClassImplementationRegex, '$1Microsoft.Graph.PowerShell.Cmdlets.Custom.ListCmdlet');
@@ -592,7 +592,7 @@ directive:
592592
let countPlaceholder = (!$.includes("SwitchParameter _count;")) ? 'global::System.Management.Automation.SwitchParameter _count;': ''
593593
$ = $.replace(beginProcessingRegex, `$1$2\n$1 ${countPlaceholder} ${topPlaceholder} if (this.InvocationInformation?.BoundParameters != null){ InitializeCmdlet(ref this.__invocationInfo, ref _top, ref _count); }\n$1`);
594594
595-
let odataNextLinkCallRegex = /(^\s*)(await\s*this\.Client\.UsersUserListUser_Call\(requestMessage\,\s*onOk\,\s*onDefault\,\s*this\,\s*Pipeline\)\;)/gmi
595+
let odataNextLinkCallRegex = /(^\s*)(await\s*this\.Client\..*_Call\(requestMessage\,\s*onOk\,\s*onDefault\,\s*this\,\s*Pipeline\)\;)/gmi
596596
$ = $.replace(odataNextLinkCallRegex, '$1requestMessage.RequestUri = GetOverflowItemsNextLinkUri(requestMessage.RequestUri);\n$1$2');
597597
598598
// Set -Count parameter to private. This will be replaced by -CountVariable

0 commit comments

Comments
 (0)