Enable-ExperimentalFeature
在启动 PowerShell 的新实例时启用实验功能。
PowerShell
Enable-ExperimentalFeature
[-Name] <String[]>
[-Scope <ConfigScope>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Enable-ExperimentalFeature
cmdlet 通过将命名实验性功能添加到 PowerShell 启动时读取的 powershell.config.json
设置文件来启用实验性功能。
PowerShell 6.2 中引入了此 cmdlet。
备注
对实验性功能状态所做的任何更改仅在重启 PowerShell 时生效
在此示例中,如果以前禁用了此实验功能,则用户更新 powershell.config.json
文件,以便在重新启动 PowerShell 后启用该功能。
成功后,任何内容都不会输出到管道,并且仅显示警告消息。
PowerShell
Enable-ExperimentalFeature PSImplicitRemotingBatching
WARNING: Enabling and disabling experimental features do not take effect until next start of PowerShell.
在运行 cmdlet 之前,提示你进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
要启用的实验功能的名称或名称。
类型: | String[] |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
确定更新 powershell.config.json
是影响所有用户还是仅影响当前用户。
类型: | ConfigScope |
接受的值: | AllUsers, CurrentUser |
Position: | Named |
默认值: | CurrentUser |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
管道从 Get-ExperimentalFeature
cmdlet 启用的 ExperimentFeature 实例。
None
此 cmdlet 不返回任何输出。
对实验功能状态的更改仅在重启 PowerShell 时生效。