Edit

Share via


Enable-PSWSManCombinedTrace

Start a logging session with the WSMan and PowerShell providers enabled.

Syntax

Default (Default)

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

Description

This cmdlet is only available on the Windows platform.

This cmdlet starts a logging session with the following PowerShell providers enabled:

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

The session is named 'PSTrace'.

This cmdlet uses the Start-Trace cmdlet.

You must run this cmdlet from an elevated PowerShell session.

Examples

Example 1: Start a combined logging session

Enable-PSWSManCombinedTrace

Parameters

-DoNotOverwriteExistingTrace

By default, the events are written to $PSHOME\Traces\PSTrace.etl. When this parameter is used, the cmdlet creates a unique filename: $PSHOME\Traces\PSTrace_{guid}.etl

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

You can't pipe objects to this cmdlet.

Outputs

None

This cmdlet returns no output.