Skip to content

Uninstall-Chocolatey

SYNOPSIS

Attempts to remove the Chocolatey Software form the system.

SYNTAX

Uninstall-Chocolatey [[-InstallDir] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This command attempts to clean the system from the Chocolatey Software files. It first look into the provided $InstallDir, or in the $Env:ChocolateyInstall if not provided. If the $InstallDir provided is $null or empty, it will attempts to find the Chocolatey folder from the choco.exe command path. If no choco.exe is found under the $InstallDir, it will fail to uninstall. This command also remove the $InstallDir from the Path.

EXAMPLES

EXAMPLE 1

Uninstall-Chocolatey -InstallDir ''
Will uninstall Chocolatey from the location of Choco.exe if found from $Env:PATH

PARAMETERS

-InstallDir

Installation Directory to remove Chocolatey from. Default looks up in $Env:ChocolateyInstall Or, if specified with an empty/$null value, tries to find from the choco.exe path.

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

Required: False
Position: 1
Default value: $Env:ChocolateyInstall
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

-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

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

Back to top