Skip to content

Remove-GitHubVariable

SYNOPSIS

Deletes a GitHub variable from an organization, repository, or environment.

SYNTAX

Environment

Remove-GitHubVariable -Owner <string> -Repository <string> -Environment <string> -Name <string>
 [-Context <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]

Repository

Remove-GitHubVariable -Owner <string> -Repository <string> -Name <string> [-Context <Object>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

Organization

Remove-GitHubVariable -Owner <string> -Name <string> [-Context <Object>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

ArrayInput

Remove-GitHubVariable -Name <string> -InputObject <GitHubVariable[]> [-Context <Object>] [-WhatIf]
 [-Confirm] [<CommonParameters>]

ALIASES

This cmdlet has the following aliases, {{Insert list of aliases}}

DESCRIPTION

Deletes a GitHub variable based on the provided scope (organization, repository, or environment).

Supports pipeline input from Get-GitHubVariable or direct array input.

Authenticated users must have collaborator access to a repository to manage variables. OAuth tokens and personal access tokens (classic) require specific scopes: - admin:org for organization-level variables. - repo for repository and environment-level variables.

EXAMPLES

EXAMPLE 1

Get-GitHubVariable -Owner 'octocat' -Repository 'Hello-World' | Remove-GitHubVariable

Removes all variables retrieved from the specified repository.

EXAMPLE 2

Remove-GitHubVariable -Owner 'octocat' -Name 'HOST_NAME' -Context $GitHubContext

Deletes the specified variable from the specified organization.

EXAMPLE 3

Remove-GitHubVariable -Variable $variablesArray

Removes all variables provided in the array.

PARAMETERS

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Context

The context to run the command in. Used to get the details for the API call. Can be either a string or a GitHubContext object.

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Environment

The name of the environment.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Environment
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-InputObject

{{ Fill InputObject Description }}

Type: GitHubVariable[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ArrayInput
  Position: Named
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name

The name of the variable.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Owner

The account owner of the repository. The name is not case sensitive.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- Organization
- User
ParameterSets:
- Name: Environment
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
- Name: Repository
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
- Name: Organization
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Repository

The name of the repository without the .git extension. The name is not case sensitive.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Environment
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
- Name: Repository
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

GitHubVariable

{{ Fill in the Description }}

System.String

{{ Fill in the Description }}

GitHubVariable[]

{{ Fill in the Description }}

OUTPUTS

void

{{ Fill in the Description }}

System.Void

{{ Fill in the Description }}

NOTES