Skip to content

Ability to quickly find runspaces that are awaiting for a debugger when attaching to a PowerShell Host Process #5598

Description

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

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:

Image

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementA feature request (enhancement).Needs: TriageMaintainer attention needed!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions