Get-TraceSource
Gets PowerShell components that are instrumented for tracing.
语法
Default (默认值)
Get-TraceSource
[[-Name] <String[]>]
[<CommonParameters>]
说明
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.
示例
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.
参数
-Name
Specifies the trace sources to get. Wildcards are permitted. The parameter name Name is optional.
参数属性
类型: | String[] |
默认值: | None |
支持通配符: | True |
不显示: | False |
参数集
(All)
Position: | 0 |
必需: | False |
来自管道的值: | True |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | 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.
输入
String
You can pipe a string that contains the name of a trace source to Get-TraceSource.
输出
PSTraceSource
Get-TraceSource returns objects that represent the trace sources.