Uninstall-ChocolateyPackage

Uninstall-ChocolateyPackage

Uninstall-ChocolateyPackage

Uninstalls software from “Programs and Features”.

Syntax

Uninstall-ChocolateyPackage `
  -PackageName <String> `
  [-FileType <String>] `
  [-SilentArgs <String[]>] `
  [-File <String>] `
  [-ValidExitCodes <Object>] `
  [-IgnoredArguments <Object[]>] [<CommonParameters>]

Description

This will uninstall software from your machine (in Programs and Features). This may not be necessary if Auto Uninstaller is turned on.

Chocolatey CLI automatically tracks registry changes for “Programs and Features” of the underlying software’s native installers when installing packages. The “Automatic Uninstaller” (auto uninstaller) service is a feature that can use that information to automatically determine how to uninstall these natively installed applications. This means that a package may not need an explicit chocolateyUninstall.ps1 to reverse the installation done in the install script.

With auto uninstaller turned off, a chocolateyUninstall.ps1 is required to perform uninstall from “Programs and Features”. In the absence of chocolateyUninstall.ps1, choco uninstall only removes the package from Chocolatey but does not remove the software from your system without auto uninstaller.

Notes

May not be required. The Automatic Uninstaller (AutoUninstaller) is turned on by default.

Aliases

None

Examples

EXAMPLE 1

Uninstall-ChocolateyPackage '__NAME__' 'EXE_OR_MSI' 'SILENT_ARGS' 'FilePath'

EXAMPLE 2


Uninstall-ChocolateyPackage -PackageName $packageName `
                                -FileType $installerType `
                                -SilentArgs "$silentArgs" `
                                -ValidExitCodes $validExitCodes `
                                -File "$file"

Inputs

None

Outputs

None

Parameters

-PackageName <String>

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

-FileType [<String>]

PropertyValue
AliasesinstallerType
Required?false
Position?2
Default Valueexe
Accept Pipeline Input?false

-SilentArgs [<String[]>]

PropertyValue
Aliases
Required?false
Position?3
Default Value
Accept Pipeline Input?false

-File [<String>]

PropertyValue
Aliases
Required?false
Position?4
Default Value
Accept Pipeline Input?false

-ValidExitCodes [<Object>]

PropertyValue
Aliases
Required?false
Position?named
Default Value@(0)
Accept Pipeline Input?false

-IgnoredArguments [<Object[]>]

PropertyValue
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

:choco-info: NOTE

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

View the source for Uninstall-ChocolateyPackage