< Back

Invoke-GHRestMethodMultipleResult

Sat Jan 18, 2020 9:38 pm

NAME Invoke-GHRestMethodMultipleResult



SYNOPSIS

A special-case wrapper around Invoke-GHRestMethod that understands GET URI's

which support the 'top' and 'max' parameters.





SYNTAX

Invoke-GHRestMethodMultipleResult [-UriFragment] <String> [-Description] <String> [[-AcceptHeader] <String>]

[[-AccessToken] <String>] [[-TelemetryEventName] <String>] [[-TelemetryProperties] <Hashtable>]

[[-TelemetryExceptionBucket] <String>] [-SinglePage] [-NoStatus] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

A special-case wrapper around Invoke-GHRestMethod that understands GET URI's

which support the 'top' and 'max' parameters.



The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub





PARAMETERS

-UriFragment <String>

The unique, tail-end, of the REST URI that indicates what Store REST action will

be peformed. This should *not* include the 'top' and 'max' parameters. These

will be automatically added as needed.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>

A friendly description of the operation being performed for logging and console

display purposes.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AcceptHeader <String>

Specify the media type in the Accept header. Different types of commands may require

different media types.



Required? false

Position? 3

Default value $script:defaultAcceptHeader

Accept pipeline input? false

Accept wildcard characters? false



-AccessToken <String>

If provided, this will be used as the AccessToken for authentication with the

REST Api as opposed to requesting a new one.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TelemetryEventName <String>

If provided, the successful execution of this REST command will be logged to telemetry

using this event name.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TelemetryProperties <Hashtable>

If provided, the successful execution of this REST command will be logged to telemetry

with these additional properties. This will be silently ignored if TelemetryEventName

is not provided as well.



Required? false

Position? 6

Default value @{}

Accept pipeline input? false

Accept wildcard characters? false



-TelemetryExceptionBucket <String>

If provided, any exception that occurs will be logged to telemetry using this bucket.

It's possible that users will wish to log exceptions but not success (by providing

TelemetryEventName) if this is being executed as part of a larger scenario. If this

isn't provided, but TelemetryEventName *is* provided, then TelemetryEventName will be

used as the exception bucket value in the event of an exception. If neither is specified,

no bucket value will be used.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SinglePage [<SwitchParameter>]

By default, this function will automtically call any follow-up "nextLinks" provided by

the return value in order to retrieve the entire result set. If this switch is provided,

only the first "page" of results will be retrieved, and the "nextLink" links will not be

followed.

WARNING: This might take a while depending on how many results there are.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-NoStatus [<SwitchParameter>]

If this switch is specified, long-running commands will run on the main thread

with no commandline status update. When not specified, those commands run in

the background, enabling the command prompt to provide status information.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

[PSCutomObject[]] - The result of the REST operation, in whatever form it comes in.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Invoke-GHRestMethodMultipleResult -UriFragment "repos/PowerShell/PowerShellForGitHub/issues?state=all"

-Description "Get all issues"



Gets the first set of issues associated with this project,

with the console window showing progress while awaiting the response

from the REST request.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Invoke-GHRestMethodMultipleResult -UriFragment "repos/PowerShell/PowerShellForGitHub/issues?state=all"

-Description "Get all issues" -NoStatus



Gets the first set of issues associated with this project,

but the request happens in the foreground and there is no additional status

shown to the user until a response is returned from the REST request.











RELATED LINKS