Uninstall-ChocolateyEnvironmentVariable

NOTE: Administrative Access Required when -VariableType 'Machine'.

Removes a persistent environment variable.

Syntax

Uninstall-ChocolateyEnvironmentVariable `
  -VariableName <String> `
  [-VariableType {Process | User | Machine}] `
  [-IgnoredArguments <Object[]>] [<CommonParameters>]

Description

Uninstall-ChocolateyEnvironmentVariable removes an environment variable
with the specified name and value. The variable can be scoped either to
the User or to the Machine. If Machine level scoping is specified, the
command is elevated to an administrative session.

Notes

Available in 0.9.10+. If you need compatibility with older versions,
use Install-ChocolateyEnvironmentVariable and set -VariableValue $null

This command will assert UAC/Admin privileges on the machine when
-VariableType Machine.

This will remove the environment variable from the current session.

Aliases

None

Examples

EXAMPLE 1


# Remove an environment variable
Uninstall-ChocolateyEnvironmentVariable -VariableName 'bob'

EXAMPLE 2


# Remove an environment variable from Machine
Uninstall-ChocolateyEnvironmentVariable -VariableName 'bob' -VariableType 'Machine'

Inputs

None

Outputs

None

Parameters

-VariableName <String>

The name or key of the environment variable to remove.

Property Value
Aliases
Required? true
Position? 1
Default Value
Accept Pipeline Input? false

-VariableType

Specifies whether this variable is at either the individual User level
or at the Machine level.

Valid options: Process, User, Machine

Property Value
Aliases
Required? false
Position? 2
Default Value User
Accept Pipeline Input? false

-IgnoredArguments [<Object[]>]

Allows splatting with arguments that do not apply. Do not use directly.

Property Value
Aliases
Required? false
Position? named
Default Value
Accept Pipeline Input? false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters http://go.microsoft.com/fwlink/p/?LinkID=113216 .

Function Reference

NOTE: This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Uninstall-ChocolateyEnvironmentVariable -Full.

View the source for Uninstall-ChocolateyEnvironmentVariable