Uninstall-Package

Uninstalls one or more software packages.
Uninstall-Package [-AdditionalArguments [<String[]>]] [-AllVersions] [-Confirm] [-WhatIf] [<CommonParameters>]
Uninstall-Package [-AdditionalArguments [<String[]>]] [-AllVersions] [-Confirm] [-WhatIf] [<CommonParameters>]
Uninstall-Package [-InputObject*] <SoftwareIdentity[]> [-AllVersions] [-Force] [-ForceBootstrap] [-Confirm][-WhatIf] [<CommonParameters>]
Uninstall-Package [-Name*] <String[]> [-AllVersions] [-Force] [-ForceBootstrap] [-MaximumVersion [<String>]][-MinimumVersion [<String>]] [-ProviderName {Programs | msi | msu | PowerShellGet | nuget | chocolatey}][-RequiredVersion [<String>]] [-Confirm] [-WhatIf] [<CommonParameters>]
Uninstall-Package [-AllVersions] [-IncludeSystemComponent] [-IncludeWindowsInstaller] [-Confirm] [-WhatIf][<CommonParameters>]
Uninstall-Package [-AllVersions] [-IncludeSystemComponent] [-IncludeWindowsInstaller] [-Confirm] [-WhatIf][<CommonParameters>]
Uninstall-Package [-AllVersions] [-InstallUpdate] [-PackageManagementProvider [<String>]] [-Scope {CurrentUser |AllUsers}] [-Type {Module | Script | All}] [-Confirm] [-WhatIf] [<CommonParameters>]
Uninstall-Package [-AllVersions] [-InstallUpdate] [-PackageManagementProvider [<String>]] [-Scope {CurrentUser |AllUsers}] [-Type {Module | Script | All}] [-Confirm] [-WhatIf] [<CommonParameters>]

The Uninstall-Package cmdlet uninstalls one or more software packages from the local computer.

Parameters
-AdditionalArguments [<String[]>]

Specifies additional arguments.

-AllVersions [<SwitchParameter>]

Indicates that this cmdlet uninstalls all versions of the package.

-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.

-ForceBootstrap [<SwitchParameter>]

Forces Package Management to automatically install the package provider for the specified package.

-IncludeSystemComponent [<SwitchParameter>]

Specifies that this cmdlet uninstalls system components.

-IncludeWindowsInstaller [<SwitchParameter>]

Indicates that this cmdlet uninstalls the package through Windows Installer.

-InputObject <SoftwareIdentity[]>

  • This value is required
  • Accepts pipeline input ByValue

Specifies a package by using the package’s SoftwareIdentity type, which is shown in the results of the Get-Package cmdlet.

-InstallUpdate [<SwitchParameter>]

Indicates that this cmdlet uninstalls updates.

-MaximumVersion [<String>]

Specifies the maximum allowed version of the package that you want to uninstall. If you do not specify this parameter, this cmdlet uninstalls the highest-numbered available version of the package on the computer.

-MinimumVersion [<String>]

Specifies the minimum allowed version of the package that you want to uninstall. If you do not add this parameter, Uninstall-Package uninstalls the newest available version of the package that also satisfies any maximum version specified by the MaximumVersion parameter.

-Name <String[]>

  • This value is required

Specifies one or more package names. Multiple names must be separated by commas.

-PackageManagementProvider [<String>]

Specifies the Package Management provider.

-ProviderName [<String[]>]

Specifies one or more package provider names to which to scope your package search. You can get package provider names by running the Get-PackageProvider cmdlet.

-RequiredVersion [<String>]

Specifies the exact allowed version of the package that you want to uninstall. If you do not add this parameter, this cmdlet installs the newest available version of the package (subject to any maximum specified version, if you’ve added the MaximumVersion parameter).

-Scope [<String>]

Specifies the scope at which to uninstall the package. The acceptable values for this parameter are:

— CurrentUser– AllUsers

-Type [<String>]

Specifies whether to search for packages with a module, a script, or both. The acceptable values for this parameter are:

— Module– Script– All

-Confirm [<SwitchParameter>]

  • Default value is false

Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.

-WhatIf [<SwitchParameter>]

  • Default value is false

Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Inputs

You cannot pipe input to this cmdlet.

Outputs

This cmdlet does not generate any output.

Examples
  1. Uninstall a package:
    PS C:> Uninstall-Package -Name "DSCAccelerator"
    

    This command uninstalls a package named DSCAccelerator.

  2. Uninstall a package by piping results of Get-Package:
    PS C:> Get-Package -Name "DSCAccelerator" -RequiredVersion "2.1.2" | Uninstall-Package -Force
    

    This command uninstalls a package named DSCAccelerator by first locating the exact package with the Get-Package cmdlet, then piping the results of Get-Package to the Uninstall-Package cmdlet. The Force parameter ensures that you are not prompted to confirm that you want to uninstall the package.

Related Links

Find-Package
Get-Package
Install-Package
Save-Package