Last active
April 18, 2020 16:42
-
-
Save raandree/5e675d28ccc72cb55ab3808007bda5f4 to your computer and use it in GitHub Desktop.
Debug DSC code running in a different process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usually the process consuming the most memory is the DSC one | |
$p = Get-Process -Name WmiPrvSE -IncludeUserName | | |
Where-Object UserName -eq 'NT AUTHORITY\SYSTEM' | | |
Sort-Object -Property WS -Descending | | |
Select-Object -First 1 | |
Enter-PSHostProcess -Process $p -AppDomainName DscPsPluginWkr_AppDomain | |
$rs = Get-Runspace | Where-Object { $_.Debugger.InBreakpoint } | |
Debug-Runspace -Runspace $rs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment