Disable-ExperimentalFeature
在启动 PowerShell 的新实例时禁用实验性功能。
语法
Disable-ExperimentalFeature
[-Name] <String[]>
[-Scope <ConfigScope>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
cmdlet Disable-ExperimentalFeature
通过从 PowerShell 启动时读取的设置文件中删除命名的实验性功能来 powershell.config.json
禁用实验性功能。
此 cmdlet 是在 PowerShell 6.2 中引入的。
注意
对实验性功能状态的任何更改仅在重启 PowerShell 时生效
示例
示例 1:禁用实验性功能
在此示例中,如果以前启用了此实验性功能,则会 powershell.config.json
更新 文件,以便用户在重启 PowerShell 后不启用该功能。
成功后,不会向管道输出任何内容,并且仅显示警告消息。
PS C:\> Disable-ExperimentalFeature PSImplicitRemotingBatching
WARNING: Enabling and disabling experimental features do not take effect until next start of PowerShell.
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
要禁用的实验性功能的名称。
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Scope
确定要更新的项 powershell.config.json
是影响所有用户还是仅影响当前用户。
Type: | ConfigScope |
Accepted values: | AllUsers, CurrentUser |
Position: | Named |
Default value: | CurrentUser |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 此 cmdlet 未运行。
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
输入
ExperimentalFeature
要 Get-ExperimentalFeature
禁用的 cmdlet 中 ExperimentalFeature 的管道实例。
输出
None
此 cmdlet 不返回任何输出。
备注
对实验性功能状态的更改仅在重启 PowerShell 时生效。