Skip to content

Remove GitHubGistFile

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

Remove-GitHubGistFile

SYNOPSIS

Removes one or more files from an existing gist on GitHub.

SYNTAX

Remove-GitHubGistFile [-Gist] <String> [-FileName] <String[]> [-Force] [-PassThru] [-AccessToken <String>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Removes one or more files from an existing gist on GitHub.

This is a helper function built on top of Set-GitHubGist.

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

EXAMPLES

EXAMPLE 1

Remove-GitHubGistFile -Gist 1234567 -FileName ('foo.txt')

Removes the file 'foo.txt' from the specified gist.

EXAMPLE 2

Remove-GitHubGistFile -Gist 1234567 -FileName ('foo.txt') -Force

Removes the file 'foo.txt' from the specified gist without prompting for confirmation.

EXAMPLE 3

@('foo.txt', 'bar.txt') | Remove-GitHubGistFile -Gist 1234567

Removes the files 'foo.txt' and 'bar.txt' from the specified 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

-FileName

An array of filenames (no paths, just names) to remove from the gist.

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

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByValue)
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

-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.Gist

NOTES

RELATED LINKS

PowerShellForGitHub

Docs

PowerShellForGitHub

Functions

Clone this wiki locally