Skip to content

Set GitHubGist

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

Set-GitHubGist

SYNOPSIS

Updates a gist on GitHub.

SYNTAX

Set-GitHubGist [-Gist] <String> [-Update <Hashtable>] [-Delete <String[]>] [-Description <String>] [-Force]
 [-PassThru] [-AccessToken <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Updates a gist on GitHub.

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

EXAMPLES

EXAMPLE 1

Set-GitHubGist -Gist 6cad326836d38bd3a7ae -Description 'This is my newer description'

Updates the description for the specified gist.

EXAMPLE 2

Set-GitHubGist -Gist 6cad326836d38bd3a7ae -Delete 'hello_world.rb' -Force

Deletes the 'hello_world.rb' file from the specified gist without prompting for confirmation.

EXAMPLE 3

Set-GitHubGist -Gist 6cad326836d38bd3a7ae -Delete 'hello_world.rb' -Description 'This is my newer description'

Deletes the 'hello_world.rb' file from the specified gist and updates the description.

EXAMPLE 4

Set-GitHubGist -Gist 6cad326836d38bd3a7ae -Update @{'hello_world.rb' = @{ 'fileName' = 'hello_universe.rb' }}

Renames the 'hello_world.rb' file in the specified gist to be 'hello_universe.rb'.

EXAMPLE 5

Set-GitHubGist -Gist 6cad326836d38bd3a7ae -Update @{'hello_world.rb' = @{ 'fileName' = 'hello_universe.rb' }}

Renames the 'hello_world.rb' file in the specified gist to be 'hello_universe.rb'.

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

-Delete

A list of filenames that should be removed from this gist.

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

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

-Description

New description for this gist.

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

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

-Force

If this switch is specified, you will not be prompted for confirmation of command execution.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Gist

The ID for the gist to update.

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

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

-PassThru

Returns the updated gist. By default, this cmdlet does not generate any output. You can use "Set-GitHubConfiguration -DefaultPassThru" to control the default behavior of this switch.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Update

A hashtable of files to update in the gist. The key should be the name of the file in the gist as it exists right now. The value should be another hashtable with the following optional key/value pairs: fileName - Specify a new name here if you want to rename the file. filePath - Specify a path to a file on disk if you wish to update the contents of the file in the gist with the contents of the specified file. Should not be specified if you use 'content' (below) content - Directly specify the raw content that the file in the gist should be updated with. Should not be used if you use 'filePath' (above).

Type: System.Collections.Hashtable
Parameter Sets: (All)
Aliases:

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

GitHub.Gist

GitHub.GistComment

GitHub.GistCommit

GitHub.GistFork

GitHub.GistSummary

OUTPUTS

GitHub.GistDetail

NOTES

RELATED LINKS

PowerShellForGitHub

Docs

PowerShellForGitHub

Functions

Clone this wiki locally