Udostępnij za pośrednictwem


Uninstall-Module

Uninstalls a module.

Składnia

NameParameterSet (Domyślna)

Uninstall-Module
    [-Name] <String[]>
    [-MinimumVersion <String>]
    [-RequiredVersion <String>]
    [-MaximumVersion <String>]
    [-AllVersions]
    [-Force]
    [-AllowPrerelease]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

InputObject

Uninstall-Module
    [-InputObject] <PSObject[]>
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Opis

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.

Przykłady

Example 1: Uninstall a module

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.

Example 2: Use the pipeline to uninstall a module

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.

Parametry

-AllowPrerelease

Allows you to uninstall a module marked as a prerelease.

The proxy cmdlet maps this parameter to the Prerelease parameter of Uninstall-PSResource

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

NameParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-AllVersions

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.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

NameParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Confirm

Prompts you for confirmation before running the Uninstall-Module.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False
Aliasy:cf

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Force

The proxy cmdlet ignores this parameter since it's not supported by Uninstall-PSResource.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-InputObject

Accepts a PSRepositoryItemInfo object. For example, output Get-InstalledModule to a variable and use that variable as the InputObject argument.

Właściwości parametru

Typ:

PSObject[]

Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

InputObject
Position:0
Obowiązkowy:True
Wartość z potoku:True
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-MaximumVersion

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.

Właściwości parametru

Typ:String
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

NameParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-MinimumVersion

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.

Właściwości parametru

Typ:String
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

NameParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-Name

Specifies an array of module names to uninstall.

Właściwości parametru

Typ:

String[]

Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

NameParameterSet
Position:0
Obowiązkowy:True
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-RequiredVersion

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.

Właściwości parametru

Typ:String
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

NameParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-WhatIf

Shows what would happen if Uninstall-Module runs. The cmdlet isn't run.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False
Aliasy:wi

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

CommonParameters

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

Dane wejściowe

String

PSObject

String

Dane wyjściowe

Object