Uninstall-Script

Uninstalls a script.

语法

NameParameterSet (默认值)

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

InputObject

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

说明

The Uninstall-Script cmdlet uninstalls a specified script from the local computer.

This is a proxy cmdlet for the Uninstall-PSResource cmdlet in the Microsoft.PowerShell.PSResourceGet. For more information, see Uninstall-PSResource.

示例

Example 1: Uninstall a script

This example uninstalls a script.

Uninstall-Script -Name UpdateManagement-Template

Uninstall-Script uses the Name parameter to specify the script to uninstall from the local computer.

Example 2: Use the pipeline to uninstall a script

In this example, the pipeline is used to uninstall a script.

Get-InstalledScript -Name UpdateManagement-Template | Uninstall-Script

Get-InstalledScript uses the Name parameter to specify the script. The object is sent down the pipeline to Uninstall-Script and the script is uninstalled.

参数

-AllowPrerelease

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

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

NameParameterSet
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

Prompts you for confirmation before running Uninstall-Script.

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Force

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

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InputObject

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

参数属性

类型:

PSObject[]

默认值:None
支持通配符:False
不显示:False

参数集

InputObject
Position:0
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值: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.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

NameParameterSet
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值: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.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

NameParameterSet
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Name

Specifies an array of script names to uninstall.

参数属性

类型:

String[]

默认值:None
支持通配符:False
不显示:False

参数集

NameParameterSet
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值: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.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

NameParameterSet
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-WhatIf

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

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:wi

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值: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.

输入

String

PSObject

String

输出

Object