PowerShell Logo Small

Set-TraceSource



This is the built-in help made by Microsoft for the command 'Set-TraceSource', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Configures, starts, and stops a trace of Windows PowerShell components.

SYNTAX


Set-TraceSource [-Name] <String[]> [[-Option] [<PSTraceSourceOptions>]] [-Debugger] [-FilePath [<String>]] [-Force] [-InformationAction {SilentlyContinue | Stop | Continue |
Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]] [-ListenerOption {None | Constructor | Dispose | Finalizer | Method | Property | Delegates | Events |
Exception | Lock | Error | Errors | Warning | Verbose | WriteLine | Data | Scope | ExecutionFlow | Assert | All}] [-PassThru] [-PSHost] [<CommonParameters>]
Set-TraceSource [-Name] <String[]> [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]]
[-RemoveListener [<String[]>]] [<CommonParameters>]
Set-TraceSource [-Name] <String[]> [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String>]]
[-RemoveFileListener [<String[]>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Set-TraceSource cmdlet configures, starts, and stops a trace of a Windows PowerShell component. You can use it to specify which components will be traced and where the
tracing output is sent.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=294014
Get-TraceSource
Set-PSDebug
Trace-Command

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>Set-TraceSource -Name Parameterbinding -Option ExecutionFlow -PSHost -ListenerOption "ProcessID,TimeStamp"



This command starts tracing for the ParameterBinding component of Windows PowerShell. It uses the Name parameter to specify the trace source, the Option parameter to select
the ExecutionFlow trace events, and the PSHost parameter to select the Windows PowerShell host listener, which sends the output to the console. The ListenerOption parameter
adds the "ProcessID" and "TimeStamp" values to the trace message prefix.










-------------------------- EXAMPLE 2 --------------------------

PS C:\>set-tracesource -name ParameterBinding -RemoveListener Host



This command stops the trace of the ParameterBinding component of Windows PowerShell. It uses the Name parameter to identify the component that was being traced and the
RemoveListener parameter to identify the trace listener.