Prerequisites
Summary
I'm working on a script that depends on the PODE module (a Web Server wrapped into a PowerShell module). The recommended approach to debugging it is to add Wait-PodeDebugger cmdlet in the code (wherever you need it to start waiting), trigger the respective code block and then attach to its process, find a runspace that's awaiting for the debugger using the below code and debug it:
Get-Runspace | Where-Object {$_.Debugger.InBreakpoint}
Unfortunately, the module produces a lot of runspaces and when you try to attach to the respective process with VSCode you see a list of ~20 runspaces with their respective RunspaceAvailability values (most of which are Busy) so picking the right one becomes a guesswork. Because of that I first need to attach to the process from a terminal, find the right runspace, detach the terminal and re-attach with VSCode:
Is it possible to add the detail about whether the runspace is awaiting for the debugger to the label? That would greatly simplify the debugging workflow.
Thanks!
Proposed Design
No response
Prerequisites
Summary
I'm working on a script that depends on the PODE module (a Web Server wrapped into a PowerShell module). The recommended approach to debugging it is to add
Wait-PodeDebuggercmdlet in the code (wherever you need it to start waiting), trigger the respective code block and then attach to its process, find a runspace that's awaiting for the debugger using the below code and debug it:Unfortunately, the module produces a lot of runspaces and when you try to attach to the respective process with VSCode you see a list of ~20 runspaces with their respective RunspaceAvailability values (most of which are Busy) so picking the right one becomes a guesswork. Because of that I first need to attach to the process from a terminal, find the right runspace, detach the terminal and re-attach with VSCode:
Is it possible to add the detail about whether the runspace is awaiting for the debugger to the label? That would greatly simplify the debugging workflow.
Thanks!
Proposed Design
No response