| external help file | PSModule-help.xml |
|---|---|
| Locale | en-US |
| Module Name | PowerShellGet |
| ms.date | 12/09/2022 |
| online version | https://learn.microsoft.com/powershell/module/powershellget/uninstall-module?view=powershellget-1.x&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | Uninstall-Module |
Uninstalls a module.
Uninstall-Module [-Name] <String[]> [-MinimumVersion <Version>] [-RequiredVersion <Version>]
[-MaximumVersion <Version>] [-AllVersions] [-Force] [-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.
You can manually delete module files, but doing so may break any modules that depend on the deleted module.
The parameters that take module version numbers expect strings formatted as version numbers.
- Standard version numbers have a format of
x.y.zwhere x, y, and z are numbers - Prerelease versions have a format of
x.y.z-<prerelease_label>where the<prerelease_label>is arbitrary string assigned to that release.
This example uninstalls a module.
Uninstall-Module -Name SpeculationControlUninstall-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-ModuleGet-InstalledModule uses the Name parameter to specify the module. The object is sent down the
pipeline to Uninstall-Module and is uninstalled.
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.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: NameParameterSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseForces Uninstall-Module to run without asking for user confirmation.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAccepts a PSRepositoryItemInfo object. For example, output Get-InstalledModule to a variable
and use that variable as the InputObject argument.
Type: System.Management.Automation.PSObject[]
Parameter Sets: InputObject
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseSpecifies the maximum, or newest, version of the module to uninstall. The MaximumVersion and RequiredVersion parameters can't be used in the same command.
Type: System.Version
Parameter Sets: NameParameterSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies the minimum version of the module to uninstall. The MinimumVersion and RequiredVersion parameters can't be used in the same command.
Type: System.Version
Parameter Sets: NameParameterSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies an array of module names to uninstall.
Type: System.String[]
Parameter Sets: NameParameterSet
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies the exact version number of the module to uninstall.
Type: System.Version
Parameter Sets: NameParameterSet
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalsePrompts you for confirmation before running the Uninstall-Module.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if Uninstall-Module runs. The cmdlet isn't run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.