Get-TraceSource

Gets PowerShell components that are instrumented for tracing.

Syntax

Get-TraceSource
   [[-Name] <String[]>]
   [<CommonParameters>]

Description

The Get-TraceSource cmdlet gets the trace sources for PowerShell components that are currently in use. You can use the data to determine which PowerShell components you can trace. When tracing, the component generates detailed messages about each step in its internal processing. Developers use the trace data to monitor data flow, program execution, and errors.

The tracing cmdlets were designed for PowerShell developers, but they are available to all users.

Examples

Example 1: Get trace sources by name

PS C:\> Get-TraceSource -Name "*provider*"

This command gets all of the trace sources that have names that include provider.

Example 2: Get all trace sources

PS C:\> Get-TraceSource

This command gets all of the PowerShell components that can be traced.

Parameters

-Name

Specifies the trace sources to get. Wildcards are permitted. The parameter name Name is optional.

Type:String[]
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

Inputs

String

You can pipe a string that contains the name of a trace source to Get-TraceSource.

Outputs

PSTraceSource

Get-TraceSource returns objects that represent the trace sources.