Get-GistCommit


Synopsis

Get a Commit of Gist Object.


Syntax

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

Aliases

None.


Description

Get a Commit from a Gist Object using the currently authenticated user context.


Parameters

-Id <string[]>
    The Id of the Gist Object.
    
    Required?                    true
    Position?                    Named
    Accept pipeline input?       true (ByValue, ByPropertyName)
    Parameter set name           (All)
    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.

Outputs

GistHistory

  • 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

Get the Commits for Gist a5b60bdf7955e029a500.

PS C:\> Get-GistCommit -Id a5b60bdf7955e029a500


User        : dotps1
Version     : 53ca8f8310ff274f43206e4228db30232076c1b0
CommittedAt : 2/3/2016 3:33:01 PM
Additions   : 1
Deletions   : 1

User        : dotps1
Version     : b3d3f9a56a27fc78780827bd9deaaa0a0b7c14f6
CommittedAt : 2/3/2016 3:31:53 PM
Additions   : 1
Deletions   : 1

User        : dotps1
Version     : f1118a739588f8f9870bee3d7272c59163533b5e
CommittedAt : 2/3/2016 3:20:37 PM
Additions   : 33
Deletions   : 0

Example 2

Get the first revision content of Gist a5b60bdf7955e029a500.

PS C:\> Get-GistCommit -Id a5b60bdf7955e029a500 | Select-Object -Last 1 | Get-GistVersion


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
Fork me on GitHub