Skip to content

Get-GitHubRepository

SYNOPSIS

Gets a specific repository or list of repositories.

SYNTAX

List repositories for the authenticated user by type (Default)

Get-GitHubRepository [-Type <String>] [-PerPage <Int32>] [-Context <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

List organization repositories

Get-GitHubRepository [-Organization <String>] [-PerPage <Int32>] [-Context <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

Get a repository by name

Get-GitHubRepository [-Organization <String>] [-Username <String>] -Name <String> [-Context <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

List user repositories

Get-GitHubRepository -Username <String> [-PerPage <Int32>] [-Context <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

List repositories for the authenticated user by affiliation and visibility

Get-GitHubRepository [-Visibility <String>] [-Affiliation <String[]>] [-Context <Object>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Gets a specific repository or list of repositories. If no parameters are specified, the authenticated user's repositories are returned. If a username is specified, the user's public repositories are returned. If an organization is specified, the organization's public repositories are returned. Can also be used with the name parameter to get a specific repository.

EXAMPLES

EXAMPLE 1

Get-GitHubRepository

Gets the repositories for the authenticated user.

EXAMPLE 2

Get-GitHubRepository -Type all

Gets the repositories owned by the authenticated user.

EXAMPLE 3

Get-GitHubRepository -Username 'octocat'

Gets the repositories for the specified user.

EXAMPLE 4

Get-GitHubRepository -Organization 'github' -Name 'octocat'

Gets the specified repository.

PARAMETERS

-Organization

The account owner of the repository. The name is not case sensitive.

Type: String
Parameter Sets: List organization repositories, Get a repository by name
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Username

The handle for the GitHub user account.

Type: String
Parameter Sets: Get a repository by name
Aliases: User

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Type: String
Parameter Sets: List user repositories
Aliases: User

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

The name of the repository without the .git extension. The name is not case sensitive.

Type: String
Parameter Sets: Get a repository by name
Aliases:

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

-Type

Specifies the types of repositories you want returned.

Type: String
Parameter Sets: List repositories for the authenticated user by type
Aliases:

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

-Visibility

Limit results to repositories with the specified visibility.

Type: String
Parameter Sets: List repositories for the authenticated user by affiliation and visibility
Aliases:

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

-Affiliation

Comma-separated list of values. Can include: - owner: Repositories that are owned by the authenticated user. - collaborator: Repositories that the user has been added to as a collaborator. - organization_member: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on.

Type: String[]
Parameter Sets: List repositories for the authenticated user by affiliation and visibility
Aliases:

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

-PerPage

The number of results per page (max 100).

Type: Int32
Parameter Sets: List repositories for the authenticated user by type, List organization repositories, List user repositories
Aliases:

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

-Context

The context to run the command in. Used to get the details for the API call. Can be either a string or a GitHubContext object.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: (Get-GitHubContext)
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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

GitHubOwner

OUTPUTS

GithubRepository

NOTES

https://psmodule.io/GitHub/Functions/Repositories/Get-GitHubRepository/