Skip to content

Get GitHubGist

Howard Wolosky edited this page Oct 5, 2020 · 1 revision

Get-GitHubGist

SYNOPSIS

Retrieves gist information from GitHub.

SYNTAX

Current (Default)

Get-GitHubGist [-Current] [-Starred] [-Since <DateTime>] [-AccessToken <String>] [<CommonParameters>]

Download

Get-GitHubGist [-Gist] <String> [-Sha <String>] [-Path] <String> [-Force] [-AccessToken <String>]
 [<CommonParameters>]

Id

Get-GitHubGist [-Gist] <String> [-Sha <String>] [-Forks] [-Commits] [-AccessToken <String>]
 [<CommonParameters>]

User

Get-GitHubGist -UserName <String> [-Since <DateTime>] [-AccessToken <String>] [<CommonParameters>]

Public

Get-GitHubGist [-Public] [-Since <DateTime>] [-AccessToken <String>] [<CommonParameters>]

DESCRIPTION

Retrieves gist information from GitHub.

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

EXAMPLES

EXAMPLE 1

Get-GitHubGist -Starred

Gets all starred gists for the current authenticated user.

EXAMPLE 2

Get-GitHubGist -Public -Since ((Get-Date).AddDays(-2))

Gets all public gists that have been updated within the past two days.

EXAMPLE 3

Get-GitHubGist -Gist 6cad326836d38bd3a7ae

Gets octocat's "hello_world.rb" gist.

PARAMETERS

-AccessToken

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.

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

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

-Commits

Gets the commits of the specified gist.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: Id
Aliases:

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

-Current

Gets the authenticated user's gists.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: Current
Aliases:

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

-Force

If downloading files, this will overwrite any files with the same name in the provided path.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: Download
Aliases:

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

-Forks

Gets the forks of the specified gist.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: Id
Aliases:

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

-Gist

The ID of the specific gist that you wish to retrieve.

Type: System.String
Parameter Sets: Download, Id
Aliases: GistId

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

-Path

Download the files that are part of the specified gist to this path.

Type: System.String
Parameter Sets: Download
Aliases:

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

-Public

Gets public gists sorted by most recently updated to least recently updated. The results will be limited to the first 3000.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: Public
Aliases:

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

-Sha

The specific revision of the gist that you wish to retrieve.

Type: System.String
Parameter Sets: Download, Id
Aliases:

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

-Since

Only gists updated at or after this time are returned.

Type: System.DateTime
Parameter Sets: Current, User, Public
Aliases:

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

-Starred

Gets the authenticated user's starred gists.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: Current
Aliases:

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

-UserName

Gets public gists for the specified user.

Type: System.String
Parameter Sets: User
Aliases:

Required: True
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

GitHub.Gist

GitHub.GistComment

GitHub.GistCommit

GitHub.GistFork

GitHub.GistSummary

OUTPUTS

GitHub.Gist

GitHub.GistCommit

GitHub.GistFork

GitHub.GistSummary

NOTES

RELATED LINKS

PowerShellForGitHub

Docs

PowerShellForGitHub

Functions

Clone this wiki locally