Desired behavior:
Set-PSBreakpoint -Script <script> -Line <##>This should also work for command and variable breakpoints.
Will this also work with breakpoints set from the editor?
That one is tricky because VS Code's debugger model doesn't give me information about breakpoints until the user starts the debugger. I've asked them about this already but we haven't come to a viable solution yet. It's the last step in making a 100% compatible debugging experience between VS Code and the ISE, so I definitely want to get it working!
It doesn't work for me (or I'm failing to understand how it's supposed to work).
Answer.psm13. Open module in VS Code
4. Set breakpoint by pressing <kbd>F9</kbd> on `42`
5. Import module via `PowerShell Integrated Console`:
```posh
Import-Module -Path .\Answer.psm1
Get-Answer function from PowerShell Integrated Console:Get-Answer
I've also tried sourcing *.ps1 file with function, but it doesn't trigger the breakpoint either. I can trigger breakpoint by running script file with F5 and then executing function from console, but I can't do this for module. It throws Cannot run a document in the middle of a pipeline error.
Extension|Author (truncated)|Version
---|---|---
PowerShell|ms-|1.4.1
I'm using the below combination and it seems that the above feature (launching from Integrated Console expecting breakpoint to be hit) only works if you manually start then stop the debugger (by hitting F5) for at least once. Is it by design or am I missing some options?
Also seems that when a breakpoint is removed, it still triggers for another time when launching script from Integrated Console. This doesn't happen by hitting F5.
And sometimes breakpoints stop triggering again and needs an F5...
The feature is handy when debugging with pipeline inputs. And ISE handles it well when launching from its Integrated Console. But ISE... ugh...
Version: 1.36.1
Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529
Date: 2019-07-08T22:59:35.033Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362
@changbowen you are not missing anything--that is a limitation of this debugging experience today where you must hit F5 at least once
Most helpful comment
That one is tricky because VS Code's debugger model doesn't give me information about breakpoints until the user starts the debugger. I've asked them about this already but we haven't come to a viable solution yet. It's the last step in making a 100% compatible debugging experience between VS Code and the ISE, so I definitely want to get it working!