Enable-PSWSManCombinedTrace

啟動已啟用 WSMan 和 PowerShell 提供者的記錄會話。

語法

Default (預設值)

Enable-PSWSManCombinedTrace
    [-DoNotOverwriteExistingTrace]
    [<CommonParameters>]

Description

此 Cmdlet 只能在 Windows 平臺上使用。

此 Cmdlet 會啟動已啟用下列 PowerShell 提供者的記錄工作階段:

  • Microsoft-Windows-PowerShell
  • Microsoft-Windows-WinRM

這個會話的名字是『PSTrace』。

此 cmdlet 會使用 Start-Trace cmdlet。

您必須從具有管理員權限的 PowerShell 工作階段執行此 cmdlet。

範例

範例 1:啟動合併記錄工作階段

Enable-PSWSManCombinedTrace

參數

-DoNotOverwriteExistingTrace

根據預設,事件會寫入至 $PSHOME\Traces\PSTrace.etl。 使用此參數時,Cmdlet 會建立唯一的檔名:$PSHOME\Traces\PSTrace_{guid}.etl

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

CommonParameters

此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters

輸入

None

您不能將物件透過管道傳送到此 Cmdlet。

輸出

None

此 Cmdlet 不會傳回任何輸出。