< Back

Get-GitHubPullRequest

Sat Jan 18, 2020 9:36 pm

NAME Get-GitHubPullRequest



SYNOPSIS

Retrieve the pull requests in the specified repository.





SYNTAX

Get-GitHubPullRequest [-OwnerName <String>] [-RepositoryName <String>] [-PullRequest <String>] [-State <String>]

[-Head <String>] [-Base <String>] [-Sort <String>] [-Direction <String>] [-AccessToken <String>] [-NoStatus]

[-WhatIf] [-Confirm] [<CommonParameters>]



Get-GitHubPullRequest -Uri <String> [-PullRequest <String>] [-State <String>] [-Head <String>] [-Base <String>]

[-Sort <String>] [-Direction <String>] [-AccessToken <String>] [-NoStatus] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

Retrieve the pull requests in the specified repository.



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





PARAMETERS

-OwnerName <String>

Owner of the repository.

If not supplied here, the DefaultOwnerName configuration property value will be used.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RepositoryName <String>

Name of the repository.

If not supplied here, the DefaultRepositoryName configuration property value will be used.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Uri <String>

Uri for the repository.

The OwnerName and RepositoryName will be extracted from here instead of needing to provide

them individually.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PullRequest <String>

The specic pull request id to return back. If not supplied, will return back all

pull requests for the specified Repository.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-State <String>

The state of the pull requests that should be returned back.



Required? false

Position? named

Default value Open

Accept pipeline input? false

Accept wildcard characters? false



-Head <String>

Filter pulls by head user and branch name in the format of 'user:ref-name'



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Base <String>

Base branch name to filter the pulls by.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Sort <String>

What to sort the results by.

* created

* updated

* popularity (comment count)

* long-running (age, filtering by pulls updated in the last month)



Required? false

Position? named

Default value Created

Accept pipeline input? false

Accept wildcard characters? false



-Direction <String>

The direction to be used for Sort.



Required? false

Position? named

Default value Descending

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. Otherwise, will attempt to use the configured value or will run unauthenticated.



Required? false

Position? named

Default value

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.

If not supplied here, the DefaultNoStatus configuration property value will be used.



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

[PSCustomObject[]] List of Pull Requests that match the specified criteria.





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



PS C:\\>$pullRequests = Get-GitHubPullRequest -Uri 'https://github.com/PowerShell/PowerShellForGitHub'













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



PS C:\\>$pullRequests = Get-GitHubPullRequest -OwnerName Microsoft -RepositoryName PowerShellForGitHub -State Closed















RELATED LINKS