-
Notifications
You must be signed in to change notification settings - Fork 511
how to make the debugger work consistently? #4281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you try PowerShell 7? The PowerShell 5.1 support is best effort, and debugging is where it gets seriously janky (it doesn't have the debugger APIs that we use to support proper debugging like we do with PowerShell 7). |
Thanks for replying, but no sadly it looks like I'll have to give up on VS Code again and go back to Powershell ISE as my only real choice for using Powershell. |
I have the same problem. Until PowerShell cmdlets for Azure etc support functionality that was available I am still expected to maintain code for customers in older versions of PowerShell. After moving the team to VSCODE its a massive step backwards as it took me months to get people off ISE. The latest is "Exception encountered starting EditorServices. Exception logged in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs on line 238 in EndProcessing:" Completely dead in the water on this This looks like its related to some update in the ps add on |
I figured it out. The problem stems from the fact that I have used Powershell a lot. This program is NOTHING LIKE Powershell ISE which I am used to. Actually, the problem is that this program is not made for Powershell and that will always be a problem. In some ways it will always be harder to use. Certainly harder to get started with. So, I expected that when I run a command from the terminal prompt, it will run. It does and that fools you because, to engage the debugger, you can ONLY USE F5 (or the icon). This means that you must create a temporary file somewhere, open it in VS Code, write the command line you need and then hit F5 there. Voila, it stops at the break point. Yes, this is very kludgy, one of the several ways Powershell presumably does not match the languages VS Code was created for. |
If you put a |
Also,
You really hit the nail on the head about how difficult the development and maintenance of this extension is 😅 |
We also have some work-in-progress to sync PowerShell breakpoints set via |
This issue has been marked as answered and has not had any activity in a day. It has been automatically closed for housekeeping purposes. |
Ah! You're a genius. ha ha I put |
Heck yeah! I'm glad to hear it. I definitely want you to be able to use (and enjoy using!) the extension, please let me know if you run into other issues. |
Prerequisites
Summary
I can't get the debugger to work. Sometimes it will, sometimes it won't. The code just runs ignoring break points. I tried to follow the instructions in https://devblogs.microsoft.com/scripting/debugging-powershell-script-in-visual-studio-code-part-1/#comments but they aren't even right. They no longer describe the user interface. So, I don't know what to do. I got the "Powershell Launch Current File" into the drop down on the RUN AND DEBUG window. It seems like that worked once, but then I stopped the run part way through the script and the terminal hung on the DBG prompt. So, I closed that terminal. It popped up a message saying that it needed to be running; so, I started it again. But now, no breaking. Did I do it right, but this Powershell extension just really is broken or what?
PowerShell Version
Visual Studio Code Version
Extension Version
code --list-extensions --show-versions | Select-String powershell
Steps to Reproduce
open file.
set breakpoint.
type command into the terminal window and hit enter.
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: