PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Foreach -Parallel Breakpoints?

Open JustinGrote opened this issue 3 years ago • 0 comments

Just thought I'd throw this discussion point out there.

If we know by the AST that someone is doing foreach -parallel, we are going to know the behavior. Can we hook into those created runspaces and drop breakpoints there, and then maybe monitor for them to go into InBreakpoint state and trigger the debugger there?

The net effect would be that users could put breakpoints in a Foreach -Parallel loop and expect it to break there for troubleshooting parallel runs, rather than the current procedure of removing -Parallel and any $USING references in order to debug.

Probably not feasible, lots of issues:

  1. How do we pause the other runspaces at the same time
  2. Have to fetch all the state and ensure it works the same thru all the existing tests
  3. etc.

JustinGrote avatar Jan 31 '22 19:01 JustinGrote