From 751f8a0635c41be5717180270d83030fa61b4ff8 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 6 Jun 2016 11:54:13 -0700 Subject: [PATCH] Add debugging info on use of Trace-Command --- docs/debugging/README.md | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/debugging/README.md b/docs/debugging/README.md index 319c423d687..531393baafe 100644 --- a/docs/debugging/README.md +++ b/docs/debugging/README.md @@ -56,6 +56,48 @@ and the C# extension. [C# extension]: https://github.com/OmniSharp/omnisharp-vscode/releases [documentation]: https://github.com/OmniSharp/omnisharp-vscode/pull/157 +PowerShell +========== + +The `Trace-Command` cmdlet can be used to enable tracing of certain PowerShell +subsystems. Use `Get-TraceSource` for a list of tracers: + +* CmdletProviderClasses +* CommandDiscovery +* CommandSearch +* ConsoleHost +* ConsoleHostRunspaceInit +* ConsoleHostUserInterface +* ConsoleLineOutput +* DisplayDataQuery +* ETS +* FileSystemProvider +* FormatFileLoading +* FormatViewBinding +* LocationGlobber +* MemberResolution +* Modules +* MshSnapinLoadUnload +* ParameterBinderBase +* ParameterBinderController +* ParameterBinding +* PathResolution +* PSDriveInfo +* PSSnapInLoadUnload +* RunspaceInit +* SessionState +* TypeConversion +* TypeMatch + +Then trace it like this: + +```powershell +Trace-Command -Expression { Get-ChildItem . } -Name PathResolution -PSHost +``` + +The `-PSHost` specifies the sink, in this case the console host, so we can see +the tracing messages. + corehost ========