Get-Gist


Synopsis

Get a Gist Object.


Syntax

Get-Gist  [<CommonParameters>]

Get-Gist [-Owner <string>]  [<CommonParameters>]

Get-Gist [-Id <string[]>]  [<CommonParameters>]

Get-Gist [-Starred]  [<CommonParameters>]

Aliases

None.


Description

Gets a Gist Object using the currently authenticated user context.


Parameters

-Id <string[]>
    The Id of the Gist Object.

    Required?                    false
    Position?                    Named
    Accept pipeline input?       true (ByValue, ByPropertyName)
    Parameter set name           Id
    Aliases                      None
    Dynamic?                     false

-Owner <string>
    The login of the GitHub User.

    Required?                    false
    Position?                    Named
    Accept pipeline input?       true (ByPropertyName)
    Parameter set name           Owner
    Aliases                      None
    Dynamic?                     false

-Starred
    Get Gists that have been starred.

    Required?                    false
    Position?                    Named
    Accept pipeline input?       false
    Parameter set name           Starred
    Aliases                      None
    Dynamic?                     false

<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see
    about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

System.String[]

  • Represents text as a sequence of UTF-16 code units.

System.String

  • Represents text as a sequence of UTF-16 code units.

Outputs

Gist

  • A custom .net object representation of the JSON response from the GitHub API.

Notes

There must be an Authenticated User Context to interact with Gist Objects.


Example 1

Gets the Gist Object ‘93258652fee1551dd0c63fbd5a37c8e0’.

PS C:\> Get-Gist -Id 93258652fee1551dd0c63fbd5a37c8e0


Owner       : dotps1
Description : Read me file for PSGist.
Id          : 93258652fee1551dd0c63fbd5a37c8e0
CreatedAt   : 1/1/2016 00:00:00 AM
UpdatedAt   : 1/1/2016 00:00:00 AM
Public      : True
HtmlUrl     : https://gist.github.com/50m3rand0m1dthatg3t5cr3at3d
Files       : README.md

Example 2

Get all Gist Objects Starred by the currently authenticated user context.

PS C:\> Get-Gist -Starred


Owner       : dotps1
Description : Find users in a domain that have the protected attribute that should not, remove that attribute and re enable inheritance.
Id          : a5b60bdf7955e029a500
CreatedAt   : 2/3/2016 3:20:37 PM
UpdatedAt   : 2/4/2016 11:59:19 AM
Public      : True
HtmlUrl     : https://gist.github.com/a5b60bdf7955e029a500
Files       : ProtectedAttributeCleanup.ps1

Owner       : dotps1
Description : Gets SQL Edition Type for each installed SQL Instance
Id          : 9050441
CreatedAt   : 2/17/2014 8:26:45 AM
UpdatedAt   : 8/29/2015 9:56:25 AM
Public      : True
HtmlUrl     : https://gist.github.com/9050441
Files       : Get-SqlEdition.ps1

Owner       : janbaer
Description : Restart your current powershell console as Administrator
Id          : 5276178
CreatedAt   : 3/30/2013 5:59:07 AM
UpdatedAt   : 12/15/2015 9:39:13 AM
Public      : True
HtmlUrl     : https://gist.github.com/5276178
Files       : gistfile1.ps1

Owner       : mshock
Description : Powershell diff
Id          : 3854782
CreatedAt   : 10/8/2012 4:29:02 PM
UpdatedAt   : 10/11/2015 7:48:02 AM
Public      : True
HtmlUrl     : https://gist.github.com/3854782
Files       : ps_diff.ps1
Fork me on GitHub