You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for hitting breakpoints set in scripts run from the integrated powershell terminal
One of the main features of the Powershell ISE for me was that I was able to just open any script, set breakpoints and run the script from the ISE console and the breakpoints would be hit. Heck even breakpoints in scripts or modules that were invoked by that script would hit.
In VS Code, I find it extremely tedious to always have to edit launch.json just to change parameters I run a script I'm developing with. I'm still exclusively using ISE for script development, just for this one missing feature in VS Code.
I tried multiple times to switch to VS Code, because I really like it overall, but I'm always going back to ISE because I can't bear the overly complicated debugging setup.
Maybe I'm missing something, I really wonder why apparently no one else requested this.
What I want to happen
I want to open any .ps1 file in VS Code, set breakpoints in that file, then go to the terminal window, and invoke that script, or any script that indirectly calls the opened file, and the breakpoints I set in the file get actually hit, as if I used F5.
The text was updated successfully, but these errors were encountered:
Looking at the underlying code, setting the breakpoint should just be calling Set-PSBreakpoint under the hood (which if you do directly does exactly what you want it to do).
But I'm also seeing the behaviour you describe. I'll try and look into it and see what would need to be done to enable this.
We are currently reworking the PowerShell extension, including the debug adapter, so while we might not be able to make this work immediately, it's likely something that will see some love in the medium term.
You can't quite do what you want because (I believe) debug sessions have to be started from VSCode. However, if you add the PowerShell Interactive Session debug config, you can start debugging with that configuration and then run scripts from the PowerShell Integrated Console and breakpoints will be hit. You can even set breakpoints from the PSIC when debugging using the PowerShell Interactive Session debug config and those breakpoints will be hit. The nice thing about that debug config is that it doesn't require any customization. Just add it to your workspace's launch config.
Support for hitting breakpoints set in scripts run from the integrated powershell terminal
One of the main features of the Powershell ISE for me was that I was able to just open any script, set breakpoints and run the script from the ISE console and the breakpoints would be hit. Heck even breakpoints in scripts or modules that were invoked by that script would hit.
In VS Code, I find it extremely tedious to always have to edit launch.json just to change parameters I run a script I'm developing with. I'm still exclusively using ISE for script development, just for this one missing feature in VS Code.
I tried multiple times to switch to VS Code, because I really like it overall, but I'm always going back to ISE because I can't bear the overly complicated debugging setup.
Maybe I'm missing something, I really wonder why apparently no one else requested this.
What I want to happen
I want to open any .ps1 file in VS Code, set breakpoints in that file, then go to the terminal window, and invoke that script, or any script that indirectly calls the opened file, and the breakpoints I set in the file get actually hit, as if I used F5.
The text was updated successfully, but these errors were encountered: