-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve paging of Invoke-WikiMethod #50
Comments
Other good sample: |
Relating to We may also be able to make use of some of the logic from the |
If the function's called without making use of the paging parameters; or if the page size is greater than the web service's supported page size, is there any preference on behaviour? i.e. With |
If no stepsize is provided, use the systems default or leave the limit out. |
|
my first attempt: |
Description
The current implementation of
Invoke-WikiMethod
's paging does not support the pipeline correctly.Demonstration
This code will have invoked
Invoke-WikiMethod
10 time where each invocation returned a result set of 100 entries. Resulting in a collection of 1000 in total.This code will have done the same as the first, but will later select the first 50 entries of the result set and return them - where only 1 invocation of
Invoke-WikiMethod
would have been enough.Fix
Invoke-WikiMethod
must be updated so that it will no longer append to arrays, but return to StdOut at once:Additionally
[CmdletBinding(SupportsPaging = $true)]
enables a function to support paging on itself.This exposes parameters such as
-Skip
,-IncludeTotalCount
and-First
.this could be implemented in the likes of:
The text was updated successfully, but these errors were encountered: