Execution policy should be checked client side before starting PowerShell Editor Services to prevent cryptic start issues
See original GitHub issueHello 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:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Dear @TylerLeonhardt , I can attach these other informations 1598516692-7d4ce1f5-9d13-4c10-baf8-2e1ab820017e1598516676631.zip
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.