diff --git a/tools/Custom/ListCmdlet.cs b/tools/Custom/ListCmdlet.cs index 13660faf15f..f5367f3e881 100644 --- a/tools/Custom/ListCmdlet.cs +++ b/tools/Custom/ListCmdlet.cs @@ -107,7 +107,17 @@ public void InitializeCmdlet(ref global::System.Management.Automation.Invocation limit = top; } - int currentPageSize = invocationInfo.BoundParameters.ContainsKey("PageSize") ? PageSize : DefaultPageSize; + int currentPageSize = DefaultPageSize; + if(invocationInfo.BoundParameters.ContainsKey("PageSize")) + { + currentPageSize = PageSize; + } + + if(invocationInfo.BoundParameters.ContainsKey("All")) + { + currentPageSize = MaxPageSize; + } + if (invocationInfo.BoundParameters.ContainsKey("Top") && limit < currentPageSize) { currentPageSize = limit;