-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Debug parameter now sets debugpreference to continue #8195
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
Debug parameter now sets debugpreference to continue #8195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully agree with this change. To me -Debug is much more useful as a data stream rather than a prompt.
PowerShell-CI-Windows temporary failed. Restart it. |
@PowerShell/powershell-committee the current PR precludes the ability to opt into the current behavior to use |
If you happen to get such a request (someone asking for |
Is the PR ready to merge? If so @KirkMunro please update the PR description (breaking change is not mentioned). |
@iSazonov: It is ready to merge, and I added more descriptive details to the first paragraph in the description to identify what would be breaking. |
@KirkMunro Thanks for the great contribution! |
I am a little late jumping to PowerShell 7.1. Recently started to while I am using MS Graph and EWS Managed API and have no need for Windows PowerShell when doing so. I was caught off guard by this change, and am very used to -Debug resulting in Inquire. I found debugging this way, way easier than anything else. Debugging in VS Code seemed difficult and so I stuck with -Debug = Inquire. I'm not necessarily opposed to the new way, but I would like to know where is some decent documentation on how to debug as easily. I really like to Suspend, jump in and investigate. It's how I hone in all my scripts and flush out errors. I don't like to just see streams of info blowing by, so really need that Suspend capability. Please do share if you can. I'll also start researching on the topic. This is a doozy of a change indeed. If it means debugging the old way in a regular PowerShell console isn't possible, ouch. |
Actually, you know it's fine. I will just get used to it. I am a little lost on debugging in general so that's on me. I see how -ErrorAction Break is essentially what I need for replacing the older -Debug = Inquire in Windows PowerShell. Using ErrorAction Break for the first time, the top 1/2 of the instructions were covered over by my frozen Write-Progress. And scrolling up, all the text is garbled. Quickly put my tail between my legs and just went back to Windows PowerShell. Saving this bit of learning for a future date. |
Jeah...i am totally out of what i'm trying to do...just want working twrp.
to my mate Pro 10bla-l29....
to 3. jouluk. 2020 klo 5.31 Jeremy <notifications@github.com> kirjoitti:
|
Hey @JeremyTBradshaw, thanks for responding back. I was really curious if there would be resistance among some folk, and the fact that you're responding rather than just silently complaining is very helpful. I'm happy to help you out with this, either via back-and-forth texts, or a call on Microsoft Teams where we can screenshare and I could show you the ropes of the debugger. That would be helpful for me as well, to learn how you would like to use the debugger, and make sure that your needs are covered. Maybe the outcome of this will be a document describing what you're looking for: how to transition from |
For this, might I suggest setting |
One last thing @JeremyTBradshaw: I do almost all of my debugging in a regular PowerShell console. Always have. Only rarely will I debug in an IDE like PowerShell ISE or VS Code. All to say, debugging in a regular PowerShell console works wonderfully. You can also do old-school debugging in PowerShell 7 anytime you like. Simply set |
Thanks for this. I would take you up on the Teams meeting offer if it still stands. Not sure when you had in mind but I've just exposed my email address on my GitHub profile and my tomorrow is currently open so if that works, that'd be great. I should be quick to pick it up, so really it won't be long, and I can quickly show you the way I've been using -Debug. The short version is that I commonly place Write-Debug's in my code wherever I'd like to jump in to troubleshoot or test, and then run with -Debug. Whereas you're confirming you do your proper debugging in the console, that is good to hear, so again, look forward to the chance to get a quick rundown on this. Thanks! |
@JeremyTBradshaw: Responded via the email address you shared, and we can work out a time through email. |
PR Summary
This is bound to generate some discussion because it is a breaking change (but not to scripts -- it breaks current interactive behavior). With this PR in place, users who invoke a command with -Debug will no longer be presented with a prompt asking them if they want to enter a nested prompt, continue execution, or halt execution entirely. Instead, any messages sent to the debug stream will simply be sent to the debug stream and the script will continue execution. That is why this is identified as a breaking change, but only for interactive use.
As described in #7122, the current -Debug behavior dates back to PowerShell v1 and hasn't been useful since the debugger was introduced in PowerShell 2. It's time this functionality be made useful again, for all of the reasons identified in #7122 (so that we can actually have debug output from specific commands show up when they are invoked with -Debug without having to go through a bunch of unwanted prompts). See the details in the bug report to understand why this change is desired by members of the PowerShell Community.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
to the beginning of the title and remove the prefix when the PR is ready.[feature]
if the change is significant or affects feature tests