-
Notifications
You must be signed in to change notification settings - Fork 513
Easy way Configure debug on specific powershell version #1302
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
Are you referring to the script/command that is to be debugged? If so, you can pass arguments to that command:
If you are referring to passing commands to PowerShell.exe, then no it doesn't do that. One issue, is that once you start VSCode and open a PowerShell file, the PowerShell Integrated Console is started to handle both language service requests (search symbols, script analysis, etc) an debug service requests. That is, before you even start debugging, PowerShell is already running. You're debugging in the PowerShell Integrated Console context. You can specify other versions of PowerShell Core via the PowerShell session menu: |
I mean Pass arguments to powershell.exe .
Launch.json provide a sample to start in a new temporary terminal. I was looking how to send arguments to powershell.exe at this launch. {
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File in Temporary Console",
"script": "${file}",
"args": [],
"cwd": "${file}",
"createTemporaryIntegratedConsole": true
}, More powershell will be updated, more we will need an easy way to switch powershell versions for testing. |
Hi @manytwo, thanks for the question. Like @rkeithhill says, there are a couple of obstacles:
@rkeithhill actually implemented way to pick what PowerShell executable you want to run on, so you can run on any PowerShell executable you have access to. But it is architecturally infeasible for us to switch PowerShell versions at runtime. In fact, just supporting as many as we do at startup is a serious challenge. But the version that the VSCode PowerShell extension supports at runtime is the version of the executable you start it with, because it reaches down into its hosting PowerShell executable to run all of its services. I believe PSScriptAnalyzer has compatibility analysis on their list (again, @rkeithhill has an issue on this: PowerShell/PSScriptAnalyzer#127). It's also very much open source, so I'm sure they would love to accept any contributions you can make.
You're right, and that is being worked on, but I will add "the more users will need to update". |
I'm closing this, since the intended resolution for this is being worked on in PSSA. |
What is PSSA? How can I use the PowerShell Core preview as the debugger? |
Is there a simple way to start a debug session to an older version of powershell?
The launch.json file can't handle powershell command line arguments, it can be an easy way to add some debug options.
I m not very familiar with advanced vscode debug configurations, How can this be done rigth now?
The text was updated successfully, but these errors were encountered: