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.

Execution policy should be checked client side before starting PowerShell Editor Services to prevent cryptic start issues

See original GitHub issue

Hello everyone,

I don’t manage to execute the Console Preview, still the message “Unable to instantiate; language client undefined”. Even though I tried to see past issued, I coudn’t manage to solve 😦

If I install PowerShell 7.0 works correctly, but I will need to use 5.1 ones for project reasons. ISE 5.1 is working fine, but… VS code is another story!

Everything with latest version I’m afraid…

Here is what I get:

8/26/2020 12:16:16 PM [NORMAL] - Visual Studio Code v1.48.2 64-bit
8/26/2020 12:16:16 PM [NORMAL] - PowerShell Extension v2020.6.0
8/26/2020 12:16:16 PM [NORMAL] - Operating System: Windows 64-bit
8/26/2020 12:16:16 PM [NORMAL] - Language server starting --
8/26/2020 12:16:16 PM [NORMAL] -     PowerShell executable: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
8/26/2020 12:16:16 PM [NORMAL] -     PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules' -EnableConsoleRepl -StartupBanner "=====> PowerShell Integrated Console v2020.6.0 <=====
" -LogLevel 'Normal' -LogPath 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\logs\1598436976-ca22623e-8ae9-41d3-bea4-4d671b2ec2bb1598436975595\EditorServices.log' -SessionDetailsPath 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\sessions\PSES-VSCode-12824-615781' -FeatureFlags @() 
8/26/2020 12:16:16 PM [NORMAL] -     PowerShell Editor Services args: Import-Module 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\modules' -EnableConsoleRepl -StartupBanner "=====> PowerShell Integrated Console v2020.6.0 <=====
" -LogLevel 'Normal' -LogPath 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\logs\1598436976-ca22623e-8ae9-41d3-bea4-4d671b2ec2bb1598436975595\EditorServices.log' -SessionDetailsPath 'c:\Users\en32071\.vscode\extensions\ms-vscode.powershell-2020.6.0\sessions\PSES-VSCode-12824-615781' -FeatureFlags @() 
8/26/2020 12:16:16 PM [NORMAL] - powershell.exe started.
8/26/2020 12:16:16 PM [NORMAL] - Waiting for session file
8/26/2020 12:16:18 PM [NORMAL] - Session file found
8/26/2020 12:16:18 PM [NORMAL] - Registering terminal close callback
8/26/2020 12:16:18 PM [NORMAL] - Registering terminal PID log callback
8/26/2020 12:16:18 PM [NORMAL] - powershell.exe PID: 17780
8/26/2020 12:16:18 PM [NORMAL] - Language server started.
8/26/2020 12:16:18 PM [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\\\.\\pipe\\PSES_tsmmuob5.tc3","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_og2bai0c.qkl"}
8/26/2020 12:16:18 PM [NORMAL] - Connecting to language service on pipe \\.\pipe\PSES_tsmmuob5.tc3...
8/26/2020 12:16:18 PM [NORMAL] - Language service connected.
8/26/2020 12:17:20 PM [ERROR] - <ConsoleFeature>: Unable to instantiate; language client undefined.

Any idea?!

Thank you!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
giojo81commented, Aug 28, 2020

Dear @TylerLeonhardt , I can attach these other informations 1598516692-7d4ce1f5-9d13-4c10-baf8-2e1ab820017e1598516676631.zip

PS > code --list-extensions --show-versions

ms-vscode.powershell@2020.6.0
vscode-icons-team.vscode-icons@10.2.0
PS > $PSVersionTable


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


PS > $psEditor.EditorServicesVersion


Major  Minor  Build  Revision
-----  -----  -----  --------
2      2      0      0

PS > code -v

1.48.2
a0479759d6e9ea56afa657e454193f72aef85bd0
x64
0reactions
TylerLeonhardtcommented, Aug 27, 2020

It’s odd to me as well that this prompt showed up when you set the log level to diagnostic. Can you provide the other logs @giojo81?

With that said, it would be nice if the vscode-powershell side could check for execution policy and warn users about this type of thing ahead of time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

about Execution Policies - PowerShell | Microsoft Learn
PowerShell's execution policy is a safety feature that controls the conditions under which PowerShell loads configuration files and runs scripts ...
Read more >
Fix for PowerShell Script cannot be loaded because running ...
Open PowerShell Console by selecting “Run as Administrator” and get the execution Policy with the command: Get-ExecutionPolicy to get the ...
Read more >
Troubleshooting - Chocolatey Software Docs
If you are seeing this, your PowerShell execution policy is either AllSigned or Restricted . You could be seeing this due to the...
Read more >
Set-ExecutionPolicy for Managing PowerShell Execution ...
Although not commonly used, you can essentially remove an execution policy by setting it to Undefined. When you set an execution policy to ......
Read more >
Citrix Workspace app unattended installation with PowerShell
Prevent an unexpected MSI repair from launching. It may happen that when you try to start a published application, an MSI installer repair...
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