-
Notifications
You must be signed in to change notification settings - Fork 511
Unable to start PowerShell extension on Windows without PS 6+ installed #2217
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
Thanks for the info! Can you also attach the logs here so we can get a better idea of what's going on? |
uploaded to the original post |
Can you attach the other log files as well? We're looking for a
Also, this is not a requirement for the extension but I'm wondering - do you have PowerShell 6+ (aka PowerShell Core, aka |
I have the same issue, additionaly to the log above, get:
|
Unfortunately this is the only log file available even the log level is set to Diagnostic |
@mohammedha do you work in an environment that is locked down via Group Policy or similar? |
@TylerLeonhardt not really, also I am running Code as Admin. |
Can you run this in a PowerShell session: [System.Environment]::OSVersion I'm curious what version of Windows you're on. Also, can you do me a favor as a test? I'd like you to installed the latest version of PowerShell to see there's a problem in how we discover what PowerShell's are installed on the system. You can grab the msi from here: |
I'm having same issue as well: (After trying disabling all over extensions, rebooting, running as admin, and trying the Machine is domain-joined work machine w/ some restrictions, and CarbonBlack. 😢
Environment Info:
|
@TylerLeonhardt - (re)installing* current release version of 6 fixed it! *I previously had v6 installed but uninstalled a while back as there was no immediate benefit, and 7 is on the way... This doesn't help me too much though, as I need v5 modules. So how do I point the PSExtension to the v5 instance of PoSh? |
You should be able to select it when you click on the PowerShell version in the bottom right hand corner |
@TylerLeonhardt Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0 Okay, I think you are right, the issue is discovering the PS version Start-EditorServices-EditorServices.log |
Thanks, I forgot about that GUI prompt. I've verified it also works w/ PoSh 7 (Preview 4), without 6 installed. |
Drat! Ok, we shall fix |
same problem here. Cannot debug or run powershell DSC scripts anymore
This started to happen after I installed PS 6 Core and then removed it. After reinstalling PS 6 Core it worked again. |
I have same issuse. When I uninstall PowerShell 6 than VSCode can't use F5 key and F8 key run powershell srcipt. When I install PowerShell 6 core it become ok. [email protected] PSVersion 5.1.18362.145 |
This is fixed in #2238 just need to finish up that PR and then we'll do a release. |
Hi, |
I've got PowerShell 7.0.3 & getting the same error as kinwolfqc & fekfoq259. Tried tonipohl's suggestion, instantly got a message that 7.0.3 was removed & reinstalled (obviously it wasn't since it finished in less than 1 second). No effect, still can't run or debug pwsh in VSCode, even though I have a pwsh terminal open in VS Code. |
Hey, first of all, sorry for commenting on a closed issue but I have something to add. If you have WSL installed and run VScode in "wsl2 mode" you'll get this error message. I ran the "WSL 2: close connection" command the error of "powershell not found" is fixed. But I find it a bit annoying that I have to do that every time, because sometimes I work only with wsl2 mode of VScode, and sometimes with the "regular" mode in which case pwsh 7 is readily available. |
If you install PowerShell on the WSL side, I assume the extension works for you as normal? It sounds like we could improve the error message when PowerShell isn't found -- I think the only reason we haven't done that is that it's surprisingly rare; PowerShell is always there on Windows, and on other platforms people are unlikely to get the extension without already having installed PowerShell. |
@rjmholt After installing wsl2 (and the vscode extension for it), it automatically defaults everything to WSL, that's why I called it a "mode". I only recently started working with wsl2 in vscode. After removing the wsl2 connection (through the mentioned command):
After all this, it seems like vscode doesn't run in "wsl2 mode" anymore automatically, unless it's started from wsl2. These are my findings. It seems like it only does it every time initially after installing the wsl2 thingy. PS: I dont have and not need pwsh on linux but I use it in windows, so this is my use case. |
Hi there,
After the the extension upgrade to 2019.9.0, I started to get the following error
Installed the previous version 2019.5 and was able to load the integrated terminal and run PS cmdlets
Versions
vscode-powershell.log
The text was updated successfully, but these errors were encountered: