Skip to content

Latest commit

 

History

History
261 lines (207 loc) · 6.65 KB

File metadata and controls

261 lines (207 loc) · 6.65 KB
external help file PSPublishModule-help.xml
Module Name PSPublishModule
online version https://github.com/EvotecIT/PSPublishModule
schema 2.0.0

Uninstall-ManagedModule

SYNOPSIS

Uninstalls installed PowerShell module versions through the managed module engine.

SYNTAX

InputObjectParameterSet (Default)

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

NameParameterSet

Uninstall-ManagedModule [-Name] <string[]> [-Version <string>] [-Prerelease] [-Scope <ManagedModuleInstallScope>] [-ShellEdition <ManagedModuleShellEdition>] [-ModuleRoot <string>] [-InstalledLocation <string>] [-SkipDependencyCheck] [-LoadedModule <ManagedModuleLoadedModule[]>] [-AllowLoadedModuleUninstall] [-Plan] [-WhatIf] [-Confirm] [<CommonParameters>]

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

EXAMPLE 1

Uninstall-ManagedModule -Name Company.Tools

EXAMPLE 2

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

EXAMPLE 3

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

PARAMETERS

-AllowLoadedModuleUninstall

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

Type: SwitchParameter
Parameter Sets: InputObjectParameterSet, NameParameterSet
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-InputObject

Installed module rows returned by Get-ManagedModule to uninstall.

Type: ModuleStateInstalledModuleResult[]
Parameter Sets: InputObjectParameterSet
Aliases: None
Possible values:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: True

-InstalledLocation

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

Type: String
Parameter Sets: NameParameterSet
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: True

-LoadedModule

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

Type: ManagedModuleLoadedModule[]
Parameter Sets: InputObjectParameterSet, NameParameterSet
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ModuleRoot

Explicit module root. Use with Scope Custom.

Type: String
Parameter Sets: NameParameterSet
Aliases: Path
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: True

-Name

Module names or wildcard patterns to uninstall.

Type: String[]
Parameter Sets: NameParameterSet
Aliases: ModuleName
Possible values:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue, ByPropertyName)
Accept wildcard characters: True

-Plan

Return an inspectable uninstall plan without removing files.

Type: SwitchParameter
Parameter Sets: InputObjectParameterSet, NameParameterSet
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-Prerelease

Restrict matching to prerelease module versions.

Type: SwitchParameter
Parameter Sets: NameParameterSet
Aliases: AllowPrerelease
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-Scope

Install scope used when ModuleRoot is not supplied.

Type: ManagedModuleInstallScope
Parameter Sets: NameParameterSet
Aliases: None
Possible values: CurrentUser, AllUsers, Custom

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ShellEdition

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

Type: ManagedModuleShellEdition
Parameter Sets: NameParameterSet
Aliases: None
Possible values: Auto, Desktop, Core

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-SkipDependencyCheck

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

Type: SwitchParameter
Parameter Sets: InputObjectParameterSet, NameParameterSet
Aliases: SkipDependenciesCheck
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-Version

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

Type: String
Parameter Sets: NameParameterSet
Aliases: RequiredVersion
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: True

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

  • System.String[] PSPublishModule.ModuleStateInstalledModuleResult[] System.String

OUTPUTS

  • PowerForge.ManagedModuleUninstallResult PowerForge.ManagedModuleUninstallPlan

RELATED LINKS

  • None