共用方式為


Disable-ExperimentalFeature

在啟動新的PowerShell實例時停用實驗性功能。

語法

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

Description

Disable-ExperimentalFeature Cmdlet 會停用實驗性功能,方法是從 PowerShell 啟動時讀取的 powershell.config.json 設定檔中移除具名實驗性功能。

此 Cmdlet 已在 PowerShell 6.2 中引進。

注意

實驗性功能狀態的任何變更只會在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重新啟動時生效。