-
Notifications
You must be signed in to change notification settings - Fork 511
command 'PowerShell.RunSelection' not found #4135
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
For this part, the logs were moved to Code's extension global storage. If you are simply accessing the old location manually, that would be why they're not there. Please run:
Do you have this command bound to F8 manually? It won't be found if the extension has not yet activated, and it only activates if you say open a PowerShell file or trigger one of these events:
If you are using |
The latest code is available in the PowerShell Preview for VS Code, and includes a myriad of fixes. Could you verify if this issue still reproduces using the preview extension? Please note that this preview is likely to include other bugs, and you should feel free to file new issues for those so we can work through them. Thanks again! |
I managed to solve and found the issue. Apparently 2022.7.2 does actually 'read' the .workspace file? I guess that that the reason is why it couldn't start PowerShell. It tries to write "powershell.cwd": to the settings section, but faulty json config (folder configurations) above it stops it from doing so. |
I couldn't get this to repro, but I added a try/catch around where we update the setting which should take care of it. |
Ok, new preview will be out momentarily. Could you please confirm you can no longer repro this? |
I'll try to test it. Will misconfigure the workspace file and install the preview version. |
Good news, it does indeed not hang on the cwd part. It ignores it and continues. |
Awesome, thanks for testing! And that's a good idea. |
Prerequisites
Summary
Since specifically version 2022.7.2 the Powershell Extention is having some issues on my end. My 2 workstations (sharing the same account ofc) getting the following errors:

When pressing F8: command 'PowerShell.RunSelection' not found
When pressing F5:
Trying to upload a bug from within VSCode:

Found some similar issues from the past, e.g.: #2526
Also not getting logs in the Logs folder, when setting the log level to diagnostic.
Version 2022.6.3 is still working fine. Works with Powershell 7.2.5 and 7.2.6 & vscode 1.70/1.70.1.
Reinstalling VSCode and/or the PowerShell extension didn't solve the issue.
My debug profile contains this for PowerShell:
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Any piece of powershell code will trigger the issue when pressing F5 or F8 for a single row in a new
$token = Read-Host -Prompt "Enter Authentication token"
Visuals
No response
Logs
None available.
The text was updated successfully, but these errors were encountered: