Disable-ExperimentalFeature

在启动 PowerShell 的新实例时禁用实验功能。

语法

Disable-ExperimentalFeature
       [-Name] <String[]>
       [-Scope <ConfigScope>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

说明

Disable-ExperimentalFeature cmdlet 通过从 PowerShell 启动时读取的 powershell.config.json 设置文件中移除已命名的试验性功能来禁用试验性功能。

PowerShell 6.2 中引入了此 cmdlet。

注意

对实验性功能状态所做的任何更改仅在重启 PowerShell 时生效

示例

示例 1:禁用实验性功能

在此示例中,如果以前启用了此实验功能,则用户更新 powershell.config.json 文件,以便在重新启动 PowerShell 后不启用该功能。 成功后,任何内容都不会输出到管道,并且仅显示警告消息。

Disable-ExperimentalFeature -Name PSImplicitRemotingBatching

WARNING: Enabling and disabling experimental features do not take effect until next start of PowerShell.

参数

-Confirm

在运行 cmdlet 之前,提示你进行确认。

类型:SwitchParameter
别名:cf
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-Name

要禁用的实验性功能的名称或名称。

类型:String[]
Position:0
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-Scope

确定要更新哪个 powershell.config.json 以及是否会影响所有用户还是仅影响当前用户。

类型:ConfigScope
接受的值:AllUsers, CurrentUser
Position:Named
默认值:CurrentUser
必需:False
接受管道输入:False
接受通配符:False

-WhatIf

显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。

类型:SwitchParameter
别名:wi
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输入

ExperimentalFeature

通过管道发送的获取自 Get-ExperimentalFeature cmdlet 的待禁用 ExperimentalFeature 实例。

输出

None

此 cmdlet 不返回任何输出。

备注

对实验功能状态的更改仅在重启 PowerShell 时生效。