Uninstall-ChocolateyPath

Uninstall-ChocolateyPath

Uninstall-ChocolateyPath

SYNOPSIS

:choco-info: NOTE

Administrative Access Required when -PathType 'Machine'. This puts a directory to the PATH environment variable.

SYNTAX

Uninstall-ChocolateyPath [-Path] <String> [[-PathType] <EnvironmentVariableTarget>]
 [-IgnoredArguments <Object[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Ensures that the given path is not present in the given type of PATH environment variable as well as in the current session.

EXAMPLES

Example 1

PS C:\> Uninstall-ChocolateyPath -PathToUninstall "$($env:SystemDrive)\tools\gittfs"

Removes the target path from the current user’s PATH environment variable.

Example 2

PS C:\> Uninstall-ChocolateyPath "$($env:SystemDrive)\Program Files\MySQL\MySQL Server 5.5\bin" -PathType 'Machine'

Removes the target path from the system-wide PATH environment variable.

PARAMETERS

-IgnoredArguments

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

Type: Object[]
Parameter Sets: (All)
Aliases:

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

-Path

The exact path to remove from the environment PATH.

Type: String
Parameter Sets: (All)
Aliases: PathToUninstall

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

-PathType

Which PATH to add it to. If specifying Machine, this requires admin privileges to run correctly.

Type: EnvironmentVariableTarget
Parameter Sets: (All)
Aliases: Scope, Type
Accepted values: Process, User, Machine

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: 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: 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

OUTPUTS

NOTES

This command will assert UAC/Admin privileges on the machine if -PathType 'Machine'. This is used when the application/tool is not being linked by Chocolatey (not in the lib folder).

Install-ChocolateyPath Install-ChocolateyEnvironmentVariable Get-EnvironmentVariableNames Set-EnvironmentVariable Get-ToolsLocation Cmdlet Reference Function Reference