< Back

Get-GitHubRepository

Sat Jan 18, 2020 9:36 pm

NAME Get-GitHubRepository



SYNOPSIS

Retrieves information about a repository or list of repositories on GitHub.





SYNTAX

Get-GitHubRepository [-OwnerName <String>] [-RepositoryName <String>] [-Visibility <String>] [-Affiliation

<String[]>] [-Type <String>] [-Sort <String>] [-Direction <String>] [-GetAllPublicRepositories] [-AccessToken

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



Get-GitHubRepository -Uri <String> [-Visibility <String>] [-Affiliation <String[]>] [-Type <String>] [-Sort

<String>] [-Direction <String>] [-GetAllPublicRepositories] [-AccessToken <String>] [-NoStatus] [-WhatIf]

[-Confirm] [<CommonParameters>]



Get-GitHubRepository [-OrganizationName <String>] [-Visibility <String>] [-Affiliation <String[]>] [-Type

<String>] [-Sort <String>] [-Direction <String>] [-GetAllPublicRepositories] [-AccessToken <String>] [-NoStatus]

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





DESCRIPTION

Retrieves information about a repository or list of repositories on GitHub.



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



-OrganizationName <String>

The name of the organization to retrieve the repositories for.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Visibility <String>

The type of visibility/accessibility for the repositories to return.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Affiliation <String[]>

Can be one or more of:



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.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Type <String>

The type of repository to return.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Sort <String>

Property that the results should be sorted by



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Direction <String>

Direction of the sort that is to be applied to the results.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-GetAllPublicRepositories [<SwitchParameter>]

If this is specified with no other parameter, then instead of returning back all

repositories for the current authenticated user, it will instead return back all

public repositories on GitHub.



Required? false

Position? named

Default value False

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



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



PS C:\\>Get-GitHubRepository



Gets all repositories for the current authenticated user.









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



PS C:\\>Get-GitHubRepository -GetAllPublicRepositories



Gets all public repositories on GitHub.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-GitHubRepository -OctoCat OctoCat













-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Get-GitHubRepository -Uri https://github.com/PowerShell/PowerShellForGitHub













-------------------------- EXAMPLE 5 --------------------------



PS C:\\>Get-GitHubRepository -OrganizationName PowerShell















RELATED LINKS