# Uninstall-ManagedModule

Uninstalls installed PowerShell module versions through the managed module engine.

Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**Module**

`PSPublishModule`

**Inputs**

`PSPublishModule.ModuleStateInstalledModuleResult[]` `System.String` `System.String[]`

**Outputs**

`PowerForge.ManagedModuleUninstallResult` `PowerForge.ManagedModuleUninstallPlan`

Uninstalls installed PowerShell module versions through the managed module engine.

## Syntax

```
Uninstall-ManagedModule
[-AllowLoadedModuleUninstall]
[-InputObject] <ModuleStateInstalledModuleResult[]>
[-LoadedModule <ManagedModuleLoadedModule[]>]
[-Plan]
[-SkipDependencyCheck]
[<CommonParameters>]
```

[#](#method-uninstall-managedmodule-switchparameter-modulestateinstalledmoduleresult-managedmoduleloadedmodule-switchparameter-switchparameter)

Parameter set: `InputObjectParameterSet`

```
Uninstall-ManagedModule
[-AllowLoadedModuleUninstall]
[-InstalledLocation <String>]
[-LoadedModule <ManagedModuleLoadedModule[]>]
[-ModuleRoot <String>]
[-Name] <String[]>
[-Plan]
[-Prerelease]
[-Scope <CurrentUser|AllUsers|Custom>]
[-ShellEdition <Auto|Desktop|Core>]
[-SkipDependencyCheck]
[-Version <String>]
[<CommonParameters>]
```

[#](#method-uninstall-managedmodule-switchparameter-string-managedmoduleloadedmodule-string-string-switchparameter-switchparameter-managedmoduleinstallscope-managedmoduleshelledition-switchparameter-string)

Parameter set: `NameParameterSet`

## Description

This command removes modules from the selected managed module root without invoking PowerShellGet or PSResourceGet. It follows PSResourceGet-shaped uninstall selection semantics while adding managed dependency and loaded-module safety checks. InstalledLocation always selects the exact installed directory, whether it is bound directly or received from Get-ManagedModule pipeline output. Typed Get-ManagedModule rows retain structured scanned-root provenance, so dependency checks preserve edition/profile visibility and require roots that were available during inventory to remain available. Multiple piped rows are preflighted as one batch across physical roots and selected dependents are removed before their selected dependencies.

## Examples

### Uninstall the latest stable installed version of a module

```powershell
Uninstall-ManagedModule -Name Company.Tools
```

### Preview every installed module version that matches a version range

```powershell
Uninstall-ManagedModule -Name Company.Tools -Version '[1.0.0,2.0.0)' -Plan
```

### Uninstall the exact installed module returned by Get-ManagedModule

```powershell
Get-ManagedModule -Name Company.Tools -Version 1.2.0 | Uninstall-ManagedModule
```

## Parameters

**-AllowLoadedModuleUninstall SwitchParameter optional**

Allow removal of module versions that appear loaded in the current PowerShell session.

**-InputObject ModuleStateInstalledModuleResult[] requiredposition: 0pipeline: True (ByValue)sets: InputObjectParameterSet**

Installed module rows returned by Get-ManagedModule to uninstall.

**-LoadedModule ManagedModuleLoadedModule[] optional**

Loaded module evidence used to block risky in-session uninstalls.

**-Plan SwitchParameter optional**

Return an inspectable uninstall plan without removing files.

**-SkipDependencyCheck SwitchParameter optionalaliases: SkipDependenciesCheck**

Skip checking whether removed modules are still required by other installed modules.

**-InstalledLocation String optionalpipeline: True (ByPropertyName)sets: NameParameterSet**

Exact installed location supplied by Get-ManagedModule pipeline rows. It takes precedence over ModuleRoot.

**-ModuleRoot String optionalpipeline: True (ByPropertyName)aliases: Pathsets: NameParameterSet**

Explicit module root. Use with Scope Custom.

**-Name String[] requiredposition: 0pipeline: True (ByValue, ByPropertyName)aliases: ModuleNamesets: NameParameterSet**

Module names or wildcard patterns to uninstall.

**-Prerelease SwitchParameter optionalaliases: AllowPrereleasesets: NameParameterSet**

Restrict matching to prerelease module versions.

**-Scope ManagedModuleInstallScope optionalsets: NameParameterSet**

Install scope used when ModuleRoot is not supplied.

Possible values: `CurrentUser`, `AllUsers`, `Custom`

**-ShellEdition ManagedModuleShellEdition optionalsets: NameParameterSet**

PowerShell path family used when resolving default CurrentUser or AllUsers module roots.

Possible values: `Auto`, `Desktop`, `Core`

**-Version String optionalpipeline: True (ByPropertyName)aliases: RequiredVersionsets: NameParameterSet**

Exact version or NuGet-style version range to uninstall. When omitted, the latest matching version is selected.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:0937C3C26729DCFE981AC0D1B6A667024C9C80487C09521EB8F04BD89FD304CB -->
