Invoke GHRestMethodMultipleResult - X-Guardian/PowerShellForGitHub GitHub Wiki

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

EXAMPLES

EXAMPLE 1

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

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.

PARAMETERS

-AcceptHeader

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

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: $script:defaultAcceptHeader
Accept pipeline input: False
Accept wildcard characters: False

-AccessToken

If provided, this will be used as the AccessToken for authentication with the REST Api as opposed to requesting a new one.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Description

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

Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NoStatus

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.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-SinglePage

By default, this function will automatically 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.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-TelemetryEventName

If provided, the successful execution of this REST command will be logged to telemetry using this event name.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TelemetryExceptionBucket

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.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TelemetryProperties

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.

Type: System.Collections.Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: @{}
Accept pipeline input: False
Accept wildcard characters: False

-UriFragment

The unique, tail-end, of the REST URI that indicates what Store REST action will be performed. This should not include the 'top' and 'max' parameters. These will be automatically added as needed.

Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

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

NOTES

RELATED LINKS

⚠️ **GitHub.com Fallback** ⚠️