Disable-ExperimentalFeature
在啟動新的PowerShell實例時停用實驗性功能。
Syntax
Disable-ExperimentalFeature
[-Name] <String[]>
[-Scope <ConfigScope>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
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重新啟動時生效。