Profiling a powershell module
sh54
Posts: 3
I have tried to profile a powershell module compiled as a 32-bit c# dotnet 3.5 library by choosing ".NET executable" where the executable is "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" and giving it arguments: noexit -command Import-Module "C:/xyz/MY-MODULE.dll"
However, whilst I get to see a graph of the CPU, I cannot inspect which methods take a long time. All the time used is placed under a row labeled "(Waiting for synchronization)".
I have no trouble attaching the Visual Studio debugger directly to powershell.exe and stepping through my source code.
Is there any specific settings I should be using to get profiling working correctly?
However, whilst I get to see a graph of the CPU, I cannot inspect which methods take a long time. All the time used is placed under a row labeled "(Waiting for synchronization)".
I have no trouble attaching the Visual Studio debugger directly to powershell.exe and stepping through my source code.
Is there any specific settings I should be using to get profiling working correctly?
Comments
You'll need to call some code in the DLL.
You can try the usual first steps - show all methods (vs just the ones that have source), show all threads, and uncheck "hide insignificant methods".