Uninstall-Module
Uninstalls a module.
Uninstall-Module
[-Name] <String[]>
[-MinimumVersion <String>]
[-RequiredVersion <String>]
[-MaximumVersion <String>]
[-AllVersions]
[-Force]
[-AllowPrerelease]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Uninstall-Module
[-InputObject] <PSObject[]>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Uninstall-Module
cmdlet uninstalls a specified module from the local computer. You can't
uninstall a module if other modules depend on it or the module wasn't installed with the
Install-Module
cmdlet.
This is a proxy cmdlet for the Uninstall-PSResource
cmdlet in the
Microsoft.PowerShell.PSResourceGet. For more information, see
Uninstall-PSResource.
This example uninstalls a module.
Uninstall-Module -Name SpeculationControl
Uninstall-Module
uses the Name parameter to specify the module to uninstall from the local
computer.
In this example, the pipeline is used to uninstall a module.
Get-InstalledModule -Name SpeculationControl | Uninstall-Module
Get-InstalledModule
uses the Name parameter to specify the module. The object is sent down the
pipeline to Uninstall-Module
and is uninstalled.
Allows you to uninstall a module marked as a prerelease.
The proxy cmdlet maps this parameter to the Prerelease parameter of Uninstall-PSResource
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies that you want to include all available versions of a module. You can't use the AllVersions parameter with the MinimumVersion, MaximumVersion, or RequiredVersion parameters.
The proxy cmdlet transforms this parameter to -Version *
before calling Uninstall-PSResource
.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Prompts you for confirmation before running the Uninstall-Module
.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The proxy cmdlet ignores this parameter since it's not supported by Uninstall-PSResource
.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Accepts a PSRepositoryItemInfo object. For example, output Get-InstalledModule
to a variable
and use that variable as the InputObject argument.
Type: | PSObject[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The proxy cmdlet uses the value of this parameter to create a NuGet version search string for use
with the Version parameter of Uninstall-PSResource
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The proxy cmdlet uses the value of this parameter to create a NuGet version search string for use
with the Version parameter of Uninstall-PSResource
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies an array of module names to uninstall.
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
The proxy cmdlet uses the value of this parameter to create a NuGet version search string for use
with the Version parameter of Uninstall-PSResource
.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Shows what would happen if Uninstall-Module
runs. The cmdlet isn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
String[]
PSObject[]
PSResourceGet feedback
PSResourceGet is an open source project. Select a link to provide feedback: