Uninstall-Package

Uninstalls one or more software packages.

Syntax

Uninstall-Package
         [-InputObject] <SoftwareIdentity[]>
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [<CommonParameters>]
Uninstall-Package
         [-Name] <String[]>
         [-RequiredVersion <String>]
         [-MinimumVersion <String>]
         [-MaximumVersion <String>]
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-ProviderName <String[]>]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-IncludeWindowsInstaller]
         [-IncludeSystemComponent]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-IncludeWindowsInstaller]
         [-IncludeSystemComponent]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-AdditionalArguments <String[]>]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-AdditionalArguments <String[]>]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-Destination <String>]
         [-ExcludeVersion]
         [-Scope <String>]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-Destination <String>]
         [-ExcludeVersion]
         [-Scope <String>]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-Scope <String>]
         [-PackageManagementProvider <String>]
         [-Type <String>]
         [-AllowClobber]
         [-SkipPublisherCheck]
         [-InstallUpdate]
         [-NoPathUpdate]
         [<CommonParameters>]
Uninstall-Package
         [-AllVersions]
         [-Force]
         [-ForceBootstrap]
         [-WhatIf]
         [-Confirm]
         [-Scope <String>]
         [-PackageManagementProvider <String>]
         [-Type <String>]
         [-AllowClobber]
         [-SkipPublisherCheck]
         [-InstallUpdate]
         [-NoPathUpdate]
         [<CommonParameters>]

Description

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

Examples

Example 1: Uninstall a package

PS C:\> Uninstall-Package -Name "DSCAccelerator"

This command uninstalls a package named DSCAccelerator.

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

Required Parameters

-InputObject

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

Type: SoftwareIdentity[]
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-Name

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

Type: String[]
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Optional Parameters

-AdditionalArguments

Specifies additional arguments.

Type: String[]
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AllVersions

Indicates that this cmdlet uninstalls all versions of the package.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AllowClobber
Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Aliases: cf
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Destination

{{Fill Destination Description}}

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ExcludeVersion

{{Fill ExcludeVersion Description}}

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ForceBootstrap

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

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeSystemComponent

Specifies that this cmdlet uninstalls system components.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-IncludeWindowsInstaller

Indicates that this cmdlet uninstalls the package through Windows Installer.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-InstallUpdate

Indicates that this cmdlet uninstalls updates.

Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MaximumVersion

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.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MinimumVersion

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.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NoPathUpdate
Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-PackageManagementProvider

Specifies the Package Management provider.

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProviderName

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.

Type: String[]
Aliases: Provider
Parameter Sets: Programs, msi, msu, PowerShellGet, nuget, chocolatey
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-RequiredVersion

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

Type: String
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Scope

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

  • CurrentUser
  • AllUsers
Type: String
Parameter Sets: CurrentUser, AllUsers
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SkipPublisherCheck
Type: SwitchParameter
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Type

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

  • Module
  • Script
  • All
Type: String
Parameter Sets: Module, Script, All
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
Aliases: wi
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Inputs

None

You cannot pipe input to this cmdlet.

Outputs

None

This cmdlet does not generate any output.