-
Notifications
You must be signed in to change notification settings - Fork 512
The language service could not be started (PowerShell Global Tool) #2620
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
@Countryen did you see #2158? |
@Countryen thanks for the detailed explanation, how did you download |
@SydneyhSmith The issue was before using https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0 I don't know how I've got the "Global Tool". @rjmholt No but thanks for the link. I didn't know there are "dotnet global tools" before this issue. |
Just FYI: The red error translates to something like: Execution not possible because file or command not found.
Note that Maybe the space in my username causes problems because it doesn't show up in the error message fully? |
So it looks like:
The PowerShell extension does its best to pick PowerShell up from well known installation paths, but won't find custom installations, so installing through the MSI to a custom path will mean you need to configure the extension to pick up your custom install as you've done. The initial load failure seems to be a combination of picking up the .NET global tool first by default (which the extension will do when it doesn't find a PowerShell 7 installation elsewhere and no default version is set) and the dotnet global tool startup failing for some reason. If you're able to share your extension logs, we might be able to work out what the invocation is that's failing when the extension tries to start the global tool. |
Here's the log for the successful use of my "custom installation":
And here is the one failing:
See the attachment for the output from the "PowerShell Editor Services" when failing Hope that's correct, this is my settings file:
|
Thanks for that! Would you be able to run this from PowerShell and respond with the result:
|
Ok that's a good sign that there's an issue with the actual dotnet global tool here. Are you able to start the executable with |
No, can't start the pwsh.exe with that command, same error message.
Output:
|
That's very odd. From my machine:
I wonder if this is a bug in your particular |
Otherwise, if you don't want the global tool, I'd recommend uninstalling it, since you already have an MSI installation |
Okay, it works now after running
Note: I did not update dotnet or anything else, yet. Why? No idea but I guess it was a weird bug that's resolved by a complete reinstall of the dotnet global tool. |
System Details
System Details Output
Issue Description
Same problem as for #2119 and #1360 and #1957 and others.
Don't know when it started but PowerShell failed to work for me and doing what's said in issue #2119 did not help. I've fixed the problem now manually with changes to
settings.json
(see below my workaround). I wanted to share my solution here.Problem: "The language service could not be started" and no support for PS in VS Code.

Additionally, every time I start VS this red message appears very shortly (like for half a second) in a terminal inside VSC (in German):
Get-ExecutionPolicy is set to Bypass (no difference when setting it to Default, either).
Executing suggested
Import-Module $HOME\.vscode\extensions\ms-vscode.powershell*\modules\PowerShellEditorServices\PowerShellEditorServices.psd1
does nothing (no question, no output, nothing).I've now installed PS7 (.NET Core version), thinking maybe it fixes the problem - doesn't fix it.
Trying the same command (Import-Module...) with PS7 - nothing different.
When using

>PowerShell: Show Session Menu
I see the following:I then select
Switch to: Windows PowerShell (x64)
and that seems to fix my problem as now the mentioned question about the "untrustworthy code" shows up and after saying [A] to it, everything works as expected.Only problem now, PS7 is not used but I really want to use the new PS7.

The "Session Menu" now shows:
I then select "Switch to: .NET Core PowerShell Global Tool" and it fails again (with the same red error message and the same error logs as described in the other issue #2119).
Here's my workaround for PS7 to work:
Adding the following to the settings.json, in my case
C:\Users\Pascal Ried\AppData\Roaming\Code\User\settings.json
toand then selecting "Switch to: PowerShell 7" in the Session Menu.
Maybe this helps someone (or future me) with the same problem.
Basically I think there is a problem with the "Global Tool" but don't know much more.
The text was updated successfully, but these errors were encountered: