Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Uninstall-Package

Uninstall-Package

microsoft.powershell.oneget.dll, microsoft.powershell.packagemanagement.dll

Synopsis

Uninstalls one or more software packages.

Syntax

Uninstall-Package [-InputObject] [-Force] [-ForceBootstrap] [-Confirm] [-WhatIf] [<CommonParameters>]

Uninstall-Package [-Name] [-Force] [-ForceBootstrap] [-MaximumVersion] [-MinimumVersion] [-ProviderName] [-RequiredVersion] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

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

Parameters

-Force <SwitchParameter>

Forces uninstallation of a package without prompting you to confirm.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ForceBootstrap <SwitchParameter>

Forces OneGet to bootstrap—or automatically install—the package provider for the specified package.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InputObject <SoftwareIdentity[]>

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

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

True (ByValue)

Accept wildcard characters?

false

-MaximumVersion <String>

Specifies the maximum allowed version of the package that you want to uninstall. If you do not add this parameter, Uninstall-Package uninstalls the newest (that is, highest-numbered) available version of the package on the computer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-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 (subject to any maximum specified version, if you’ve added the MaximumVersion parameter).

Aliases

Version

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Name <String[]>

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

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

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

Aliases

Provider

Required?

false

Position

named

Default value

None

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

-RequiredVersion <String>

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

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

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

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

None

Examples

Example 1: Uninstall a package

This command uninstalls a package named DSCAccelerator.

PS C:\>Uninstall-Package –Name DSCAccelerator

Example 2: Uninstall a package by piping results of Get-Package

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.

PS C:\>Get-Package –Name DSCAccel –RequiredVersion 2.1.2 | Uninstall-Package -Force

Online Version
Find-Package
Get-Package
Install-Package
Save-Package