question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VSCode-PowerShell - Allsigned GPO fails with "Could not start language service:"

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

We are just now setting our environment to AllSigned - prior to this it has worked fine. If I set it to RemoteSigned I can get it to work but not AllSigned.

I’ve done many searches on this and I find one article from 2018 that sounds the same but they just state they will fix in the next version and no discussion or other comments continued.

What am I missing! Thanks

12/15/2021 11:21:58 AM [NORMAL] - PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1’; Start-EditorServices -HostName ‘Visual Studio Code Host’ -HostProfileId ‘Microsoft.VSCode’ -HostVersion ‘2021.10.2’ -AdditionalModules @(‘PowerShellEditorServices.VSCode’) -BundledModulesPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules’ -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.10.2 <===== ’ -LogLevel ‘Normal’ -LogPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\logs\1639588918-03abed12-2b07-4b8a-8bf2-bc24ef0ca5931639588477125\EditorServices.log’ -SessionDetailsPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\sessions\PSES-VSCode-4664-762895’ -FeatureFlags @() 12/15/2021 11:21:58 AM [NORMAL] - Language server starting – 12/15/2021 11:21:58 AM [NORMAL] - Waiting for session file 12/15/2021 11:21:58 AM [NORMAL] - PowerShell executable: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe 12/15/2021 11:21:58 AM [NORMAL] - PowerShell Editor Services args: Import-Module ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1’; Start-EditorServices -HostName ‘Visual Studio Code Host’ -HostProfileId ‘Microsoft.VSCode’ -HostVersion ‘2021.10.2’ -AdditionalModules @(‘PowerShellEditorServices.VSCode’) -BundledModulesPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules’ -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.10.2 <===== ’ -LogLevel ‘Normal’ -LogPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\logs\1639588918-03abed12-2b07-4b8a-8bf2-bc24ef0ca5931639588477125\EditorServices.log’ -SessionDetailsPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\sessions\PSES-VSCode-4664-762895’ -FeatureFlags @() 12/15/2021 11:21:58 AM [NORMAL] - powershell.exe started. 12/15/2021 11:22:32 AM [NORMAL] - Session file found 12/15/2021 11:22:32 AM [NORMAL] - Registering terminal close callback 12/15/2021 11:22:32 AM [NORMAL] - Registering terminal PID log callback 12/15/2021 11:22:32 AM [NORMAL] - powershell.exe PID: 28624 12/15/2021 11:22:32 AM [NORMAL] - {“status”:“started”,“languageServiceTransport”:“NamedPipe”,“languageServicePipeName”:“\\.\pipe\PSES_hkczklnk.kdt”,“debugServiceTransport”:“NamedPipe”,“debugServicePipeName”:“\\.\pipe\PSES_go3bwwbg.0fo”} 12/15/2021 11:22:32 AM [NORMAL] - Language server started. 12/15/2021 11:22:32 AM [NORMAL] - Connecting to language service on pipe \.\pipe\PSES_hkczklnk.kdt… 12/15/2021 11:22:32 AM [NORMAL] - Language service connected. 12/15/2021 11:30:27 AM [ERROR] - Error: Connection to server got closed. Server will not be restarted. 12/15/2021 11:30:27 AM [ERROR] - Could not start language service: 12/15/2021 11:30:29 AM [NORMAL] - powershell.exe terminated or terminal UI was closed

PowerShell Version

Name                           Value                                                                                                                                                                                                
----                           -----                                                                                                                                                                                                
PSVersion                      5.1.19041.1320                                                                                                                                                                                       
PSEdition                      Desktop                                                                                                                                                                                              
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                              
BuildVersion                   10.0.19041.1320                                                                                                                                                                                      
CLRVersion                     4.0.30319.42000                                                                                                                                                                                      
WSManStackVersion              3.0                                                                                                                                                                                                  
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                  
SerializationVersion           1.1.0.1

Visual Studio Code Version

1.63.1
fe719cd3e5825bf14e14182fddeb88ee8daf044f
x64

From PowerShell 7 which does run in VSCode as I do not have the AllSigned set there yet

Extension Version

ronmansoftware.powershellprotools@2021.12.0         Disabled
ms-vscode.powershell@2021.10.2
ms-vscode.powershell-preview@2021.11.1              Disabled

I've tried it with just PowerShell along as well

Steps to Reproduce

set GPO to AllSigned and launch VSCode with PowerShell extension for Version 5.1

Visuals

No response

Logs

12/15/2021 11:21:58 AM [NORMAL] - PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1’; Start-EditorServices -HostName ‘Visual Studio Code Host’ -HostProfileId ‘Microsoft.VSCode’ -HostVersion ‘2021.10.2’ -AdditionalModules @(‘PowerShellEditorServices.VSCode’) -BundledModulesPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules’ -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.10.2 <===== ’ -LogLevel ‘Normal’ -LogPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\logs\1639588918-03abed12-2b07-4b8a-8bf2-bc24ef0ca5931639588477125\EditorServices.log’ -SessionDetailsPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\sessions\PSES-VSCode-4664-762895’ -FeatureFlags @() 12/15/2021 11:21:58 AM [NORMAL] - Language server starting – 12/15/2021 11:21:58 AM [NORMAL] - Waiting for session file 12/15/2021 11:21:58 AM [NORMAL] - PowerShell executable: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe 12/15/2021 11:21:58 AM [NORMAL] - PowerShell Editor Services args: Import-Module ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules\PowerShellEditorServices\PowerShellEditorServices.psd1’; Start-EditorServices -HostName ‘Visual Studio Code Host’ -HostProfileId ‘Microsoft.VSCode’ -HostVersion ‘2021.10.2’ -AdditionalModules @(‘PowerShellEditorServices.VSCode’) -BundledModulesPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\modules’ -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2021.10.2 <===== ’ -LogLevel ‘Normal’ -LogPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\logs\1639588918-03abed12-2b07-4b8a-8bf2-bc24ef0ca5931639588477125\EditorServices.log’ -SessionDetailsPath ‘c:\Users\Me.vscode\extensions\ms-vscode.powershell-2021.10.2\sessions\PSES-VSCode-4664-762895’ -FeatureFlags @() 12/15/2021 11:21:58 AM [NORMAL] - powershell.exe started. 12/15/2021 11:22:32 AM [NORMAL] - Session file found 12/15/2021 11:22:32 AM [NORMAL] - Registering terminal close callback 12/15/2021 11:22:32 AM [NORMAL] - Registering terminal PID log callback 12/15/2021 11:22:32 AM [NORMAL] - powershell.exe PID: 28624 12/15/2021 11:22:32 AM [NORMAL] - {“status”:“started”,“languageServiceTransport”:“NamedPipe”,“languageServicePipeName”:“\\.\pipe\PSES_hkczklnk.kdt”,“debugServiceTransport”:“NamedPipe”,“debugServicePipeName”:“\\.\pipe\PSES_go3bwwbg.0fo”} 12/15/2021 11:22:32 AM [NORMAL] - Language server started. 12/15/2021 11:22:32 AM [NORMAL] - Connecting to language service on pipe \.\pipe\PSES_hkczklnk.kdt… 12/15/2021 11:22:32 AM [NORMAL] - Language service connected. 12/15/2021 11:30:27 AM [ERROR] - Error: Connection to server got closed. Server will not be restarted. 12/15/2021 11:30:27 AM [ERROR] - Could not start language service: 12/15/2021 11:30:29 AM [NORMAL] - powershell.exe terminated or terminal UI was closed

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MN-Joecommented, Dec 21, 2021

The Preview release works with the 9/1/2022 certificate except it comes up in noninteractive mode and I’m not finding out to change that. The main release I think would be great if we could get the certificate updated. For PowerShell 7 we do not have that GPO set yet to AllSigned so those work without the certificate being upgraded.

0reactions
msftbot[bot]commented, Dec 23, 2021

This issue has been marked as duplicate and has not had any activity in a day. It has been closed for housekeeping purposes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Visual Studio Code for PowerShell Development
Language server startup failed. This problem can occur when PowerShell's execution policy is set by Windows Group Policy. To manually approve ...
Read more >
Running scripts is disabled on this system - Issue FIXED
Are you facing these errors? 1) PowerShell - Running scripts is disabled on this system 2) PowerShell Script cannot be loaded because ...
Read more >
VSCode overrides PowerShell ExecutionPolicy - Stack Overflow
I want to be able to check/set the ExecutionPolicy for VSCode to RemoteSigned when it starts the language server , where do I...
Read more >
Fixing Visual Studio Code Failed to Run PowerShell Scripts
After a Visual Studio Code update the other day, all the PowerShell scripts refusing to run due to a "Language server startup failed"....
Read more >
The Language Service could not be started
In VS Code I'm receiving an error that reads “The Language Service could not be started” and I'm unable to run PowerShell Pro...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found