PowerShell Logo Small

Set-TraceSource



This is the built-in help made by Microsoft for the command 'Set-TraceSource', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' 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] [-ListenerOption <TraceOptions>] [-PassThru] [-PSHost]
[<CommonParameters>]
Set-TraceSource [-Name] <String[]> [-RemoveFileListener <String[]>] [<CommonParameters>]
Set-TraceSource [-Name] <String[]> [-RemoveListener <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 wher
e 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 ListenerOpt
ion 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 t
he RemoveListener parameter to identify the trace listener.