< Back

Uninstall-Chocolatey

Mon Jan 13, 2020 1:46 am

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





PARAMETERS

-InstallDir <String>

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.



Required? false

Position? 1

Default value $Env:ChocolateyInstall

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Uninstall-Chocolatey -InstallDir ''



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











RELATED LINKS