< Back

Uninstall-Package

Sat Jan 18, 2020 6:24 pm

NAME Uninstall-Package



SYNOPSIS

Uninstalls one or more software packages.





SYNTAX

Uninstall-Package [-AdditionalArguments <String[]>] [-AllVersions] [-Confirm] [-Force] [-ForceBootstrap] [-WhatIf]

[<CommonParameters>]



Uninstall-Package [-AdditionalArguments <String[]>] [-AllVersions] [-Confirm] [-Force] [-ForceBootstrap] [-WhatIf]

[<CommonParameters>]



Uninstall-Package [-AllVersions] [-AllowClobber] [-Confirm] [-Force] [-ForceBootstrap] [-InstallUpdate]

[-NoPathUpdate] [-PackageManagementProvider <String>] [-Scope {CurrentUser | AllUsers}] [-SkipPublisherCheck]

[-Type {Module | Script | All}] [-WhatIf] [<CommonParameters>]



Uninstall-Package [-AllVersions] [-AllowClobber] [-Confirm] [-Force] [-ForceBootstrap] [-InstallUpdate]

[-NoPathUpdate] [-PackageManagementProvider <String>] [-Scope {CurrentUser | AllUsers}] [-SkipPublisherCheck]

[-Type {Module | Script | All}] [-WhatIf] [<CommonParameters>]



Uninstall-Package [-AllVersions] [-Confirm] [-Destination <String>] [-ExcludeVersion] [-Force] [-ForceBootstrap]

[-Scope {CurrentUser | AllUsers}] [-SkipDependencies] [-WhatIf] [<CommonParameters>]



Uninstall-Package [-AllVersions] [-Confirm] [-Destination <String>] [-ExcludeVersion] [-Force] [-ForceBootstrap]

[-Scope {CurrentUser | AllUsers}] [-SkipDependencies] [-WhatIf] [<CommonParameters>]



Uninstall-Package [-AllVersions] [-Confirm] [-Force] [-ForceBootstrap] [-IncludeSystemComponent]

[-IncludeWindowsInstaller] [-WhatIf] [<CommonParameters>]



Uninstall-Package [-AllVersions] [-Confirm] [-Force] [-ForceBootstrap] [-IncludeSystemComponent]

[-IncludeWindowsInstaller] [-WhatIf] [<CommonParameters>]



Uninstall-Package [-InputObject] <SoftwareIdentity[]> [-AllVersions] [-Confirm] [-Force] [-ForceBootstrap]

[-WhatIf] [<CommonParameters>]



Uninstall-Package [-Name] <String[]> [-AllVersions] [-Confirm] [-Force] [-ForceBootstrap] [-MaximumVersion

<String>] [-MinimumVersion <String>] [-ProviderName {msi | NuGet | msu | Programs | PowerShellGet | psl |

chocolatey}] [-RequiredVersion <String>] [-WhatIf] [<CommonParameters>]





DESCRIPTION

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





PARAMETERS

-AdditionalArguments <String[]>

Specifies additional arguments.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AllVersions [<SwitchParameter>]

Indicates that this cmdlet uninstalls all versions of the package.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AllowClobber [<SwitchParameter>]

@{Text=}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Destination <String>

{{Fill Destination Description}}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ExcludeVersion [<SwitchParameter>]

{{Fill ExcludeVersion Description}}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-ForceBootstrap [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-IncludeSystemComponent [<SwitchParameter>]

Specifies that this cmdlet uninstalls system components.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-IncludeWindowsInstaller [<SwitchParameter>]

Indicates that this cmdlet uninstalls the package through Windows Installer.



Required? false

Position? named

Default value False

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.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-InstallUpdate [<SwitchParameter>]

Indicates that this cmdlet uninstalls updates.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



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



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 that also satisfies any

maximum version specified by the MaximumVersion parameter.



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.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NoPathUpdate [<SwitchParameter>]

@{Text=}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-PackageManagementProvider <String>

Specifies the Package Management provider.



Required? false

Position? named

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.



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, this cmdlet installs the newest available version of the package (subject to any maximum specified

version, if you've added the MaximumVersion parameter).



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Scope <String>

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



- CurrentUser



- AllUsers



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SkipDependencies [<SwitchParameter>]

{{Fill SkipDependencies Description}}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-SkipPublisherCheck [<SwitchParameter>]

@{Text=}



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

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



You cannot pipe input to this cmdlet.





OUTPUTS



This cmdlet does not generate any output.





NOTES









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.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=517142

about_PackageManagement

Find-Package

Get-Package

Install-Package

Save-Package