当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 启用实验功能 (Microsoft.PowerShell.Core)

作者:精品下载站 日期:2024-12-14 02:16:40 浏览:16 分类:玩电脑

启用实验功能 (Microsoft.PowerShell.Core)


Enable-ExperimentalFeature

模块 :Microsoft.PowerShell.Core

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

句法

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

描述

Enable-ExperimentalFeature cmdlet 通过将指定的实验功能添加到 PowerShell 启动时读取的 powershell.config.json 设置文件来启用实验功能。

此 cmdlet 是在 PowerShell 6.2 中引入的。

笔记

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

示例

示例 1:启用实验性功能

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

Enable-ExperimentalFeature PSImplicitRemotingBatching

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

参数

-Confirm

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

类型 :

SwitchParameter

别名:

cf

位置:

命名

默认值:

None

必需的:

False

接受管道输入:

False

接受通配符:

False

-Name

要启用的实验性功能的名称。

类型 :

String[]

位置:

0

默认值:

None

必需的:

True

接受管道输入:

True

接受通配符:

False

-Scope

确定要更新的 powershell.config.json 是否影响所有用户或仅影响当前用户。

类型 :

ConfigScope

接受的值:

所有用户、当前用户

位置:

命名

默认值:

CurrentUser

必需的:

False

接受管道输入:

False

接受通配符:

False

-WhatIf

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

类型 :

SwitchParameter

别名:

wi

位置:

命名

默认值:

None

必需的:

False

接受管道输入:

False

接受通配符:

False

输入

实验功能

通过管道传输 Get-ExperimentalFeature cmdlet 中的 ExperimentalFeature 实例以启用。

输出

此 cmdlet 不返回任何输出。

笔记

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

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯