Repository navigation
Uninstall ManagedModule
Uninstalls modules, or specific versions of modules.
Uninstall-ManagedModule -ModuleBase <String[]> [-Force] [-ProgressAction <ActionPreference>] [-WhatIf]
[-Confirm] [<CommonParameters>]
Uninstall-ManagedModule [-Name] <String[]> [-Version <String[]>] [-Scope <String[]>] [-Force]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Removes installed module versions from disk, whether they were installed by PowerShellGet, PSResourceGet or copied in by hand.
Safety checks:
- Modules that ship with PowerShell or Windows are never removed.
- Loaded modules are skipped unless -Force is used.
- Removing a version that another installed module depends on is blocked unless -Force is used. Dependencies are read from the package manager's install record (PSGetModuleInfo.xml), or the manifest for modules copied in by hand, and are checked against the version range each module needs. For example, the Az rollup module pins exact versions of each Az.* module.
- AllUsers installs require an elevated session.
Prompts for confirmation for each version by default. Use -Confirm:$false to skip prompts, or -WhatIf to preview.
Uninstall-ManagedModule OldModule
Removes every installed version of OldModule.
Uninstall-ManagedModule Pester -Version 4.*
Removes only the Pester 4.x versions, keeping any others.
Get-ModuleLocation Az.* -Scope AllUsers | Uninstall-ManagedModule -WhatIf
Shows which all-users Az module versions would be removed, without removing anything.
The module name(s) to uninstall. Wildcards are supported. All versions are removed unless -Version is given.
Type: String[]
Parameter Sets: ByName
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: TrueOnly remove these versions (for example '1.2.0' or '2.0.0-beta1'). Wildcards are supported.
Type: String[]
Parameter Sets: ByName
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOnly remove versions installed in these scopes.
Type: String[]
Parameter Sets: ByName
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe folder of a specific installed version. Bound automatically when you pipe output from Get-ModuleLocation or Get-ModuleInventory -AllVersions.
Type: String[]
Parameter Sets: ByModuleBase
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseRemove modules even if they are loaded, or required by other installed modules.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{Fill ProgressAction Description}}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
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 (http://go.microsoft.com/fwlink/?LinkID=113216).