The Uninstall-Package command is a powerful tool in Windows PowerShell that enables users to remove packages from their system. This command is especially useful for managing software installations, as it allows users to quickly and easily remove any unwanted packages from their system. In this article, we will discuss the syntax, parameters, inputs, outputs, examples, and tips for using the Uninstall-Package command.
Syntax
The syntax for the Uninstall-Package command is as follows:
Uninstall-Package [-Name] <String> [-RequiredVersion] <String> [-WhatIf] [-Confirm] [-Force] [-Source <String>] [-Credential <PSCredential>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-SkipPublisherCheck] [-ForceBootstrapper] [-WhatIfBootstrapper] [-ConfirmBootstrapper] [-AllowUnsigned] [-AllowUntrusted] [-IgnoreDependencies] [-ForceDependencies] [-AllowPrerelease] [-AllowMultipleVersions] [-ForceAllVersions] [-ForceRemove] [-SkipDependencies] [-PackageManagementProvider <String>] [-Repository <String>] [-Scope <String>] [-Culture <String>] [-Debug] [-Verbose] [-ErrorAction <ActionPreference>] [-WarningAction <ActionPreference>] [-ErrorVariable <String>] [-WarningVariable <String>] [-OutVariable <String>] [-OutBuffer <Int32>] [-PipelineVariable <String>]
Parameters
The Uninstall-Package command has the following parameters:
Parameter | Description |
---|---|
-Name |
Specifies the name of the package to uninstall. |
-RequiredVersion |
Specifies the version of the package to uninstall. |
-WhatIf |
Shows what would happen if the command is run without actually running the command. |
-Confirm |
Prompts the user for confirmation before running the command. |
-Force |
Forces the uninstallation of the package, even if it is in use. |
-Source |
Specifies the source from which to uninstall the package. |
-Credential |
Specifies the credentials to use when connecting to the source. |
-Proxy |
Specifies the proxy server to use when connecting to the source. |
-ProxyCredential |
Specifies the credentials to use when connecting to the proxy server. |
-SkipPublisherCheck |
Skips the publisher check when uninstalling the package. |
-ForceBootstrapper |
Forces the uninstallation of the package, even if the bootstrapper fails. |
-WhatIfBootstrapper |
Shows what would happen if the bootstrapper is run without actually running the bootstrapper. |
-ConfirmBootstrapper |
Prompts the user for confirmation before running the bootstrapper. |
-AllowUnsigned |
Allows the uninstallation of unsigned packages. |
-AllowUntrusted |
Allows the uninstallation of untrusted packages. |
-IgnoreDependencies |
Ignores any dependencies when uninstalling the package. |
-ForceDependencies |
Forces the uninstallation of any dependencies when uninstalling the package. |
-AllowPrerelease |
Allows the uninstallation of pre-release packages. |
-AllowMultipleVersions |
Allows the uninstallation of multiple versions of the same package. |
-ForceAllVersions |
Forces the uninstallation of all versions of the package. |
-ForceRemove |
Forces the removal of the package, even if it is in use. |
-SkipDependencies |
Skips the uninstallation of any dependencies when uninstalling the package. |
-PackageManagementProvider |
Specifies the package management provider to use when uninstalling the package. |
-Repository |
Specifies the repository from which to uninstall the package. |
-Scope |
Specifies the scope from which to uninstall the package. |
-Culture |
Specifies the culture for the package. |
-Debug |
Enables debug mode. |
-Verbose |
Enables verbose mode. |
-ErrorAction |
Specifies the action to take if an error occurs. |
-WarningAction |
Specifies the action to take if a warning occurs. |
-ErrorVariable |
Specifies the variable in which to store any errors that occur. |