Created
July 29, 2019 10:07
-
-
Save raandree/b6f22fd2b9934a9d4d656fd2ec196452 to your computer and use it in GitHub Desktop.
This script attaches to the DSC LCM's PSHostProcess for debugging the runspace that is in state 'AtBreakpoint'
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 one that hosts the LCM | |
$p = Get-Process -Name WmiPrvSE | Sort-Object -Property WS -Descending | Select-Object -First 1 | |
Enter-PSHostProcess -Process $p -AppDomainName DscPsPluginWkr_AppDomain | |
Start-Sleep -Seconds 1 | |
$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