Skip to content

Commit 096779d

Browse files
committed
Merge pull request PowerShell#1076 from PowerShell/andschwa/trace-command-docs
Add debugging info on use of Trace-Command
2 parents 527dbd2 + 751f8a0 commit 096779d

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

docs/debugging/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,48 @@ and the C# extension.
5656
[C# extension]: https://github.com/OmniSharp/omnisharp-vscode/releases
5757
[documentation]: https://github.com/OmniSharp/omnisharp-vscode/pull/157
5858

59+
PowerShell
60+
==========
61+
62+
The `Trace-Command` cmdlet can be used to enable tracing of certain PowerShell
63+
subsystems. Use `Get-TraceSource` for a list of tracers:
64+
65+
* CmdletProviderClasses
66+
* CommandDiscovery
67+
* CommandSearch
68+
* ConsoleHost
69+
* ConsoleHostRunspaceInit
70+
* ConsoleHostUserInterface
71+
* ConsoleLineOutput
72+
* DisplayDataQuery
73+
* ETS
74+
* FileSystemProvider
75+
* FormatFileLoading
76+
* FormatViewBinding
77+
* LocationGlobber
78+
* MemberResolution
79+
* Modules
80+
* MshSnapinLoadUnload
81+
* ParameterBinderBase
82+
* ParameterBinderController
83+
* ParameterBinding
84+
* PathResolution
85+
* PSDriveInfo
86+
* PSSnapInLoadUnload
87+
* RunspaceInit
88+
* SessionState
89+
* TypeConversion
90+
* TypeMatch
91+
92+
Then trace it like this:
93+
94+
```powershell
95+
Trace-Command -Expression { Get-ChildItem . } -Name PathResolution -PSHost
96+
```
97+
98+
The `-PSHost` specifies the sink, in this case the console host, so we can see
99+
the tracing messages.
100+
59101
corehost
60102
========
61103

0 commit comments

Comments
 (0)