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.

Unable to start PowerShell extension on Windows without PS 6+ installed

See original GitHub issue

Hi there,

After the the extension upgrade to 2019.9.0, I started to get the following error

30/09/2019 11:02:49 [NORMAL] - Visual Studio Code v1.38.1 64-bit
30/09/2019 11:02:49 [NORMAL] - PowerShell Extension v2019.9.0
30/09/2019 11:02:49 [NORMAL] - Operating System: Windows 64-bit
30/09/2019 11:02:49 [NORMAL] - Path specified by 'powerShellExePath' setting - '' - not found, reverting to default PowerShell path.
30/09/2019 11:03:15 [ERROR] - <ConsoleFeature>: Unable to instantiate; language client undefined.

Installed the previous version 2019.5 and was able to load the integrated terminal and run PS cmdlets

VERBOSE: 
#-- Console Encoding ---------------------------------------------------------
VERBOSE: System.Text.ASCIIEncoding
VERBOSE: 
#-- Updated PSModulePath to: -------------------------------------------------
VERBOSE: C:\Users\mohamed\Documents\WindowsPowerShell\Modules
VERBOSE: C:\Program Files\WindowsPowerShell\Modules
VERBOSE: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
VERBOSE: c:\Users\mohamed\.vscode\extensions\ms-vscode.powershell-2019.5.0\modules
VERBOSE: 
#-- Check required modules available -----------------------------------------
VERBOSE: Testing module availability PowerShellGet 
VERBOSE: Populating RepositorySourceLocation property for module PowerShellGet.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2\PSModule.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module PowerShellGet.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.1.4\PSModule.psm1'.
VERBOSE: Populating RepositorySourceLocation property for module PowerShellGet.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.0.4\PSModule.psm1'.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1'.
VERBOSE: PowerShellGet  found

Versions

> code --list-extensions --show-versions
akamud.vscode-theme-onedark@2.1.0
bmuskalla.vscode-tldr@1.0.0
CoenraadS.bracket-pair-colorizer@1.0.61
Darfka.vbscript@1.0.4
DougFinke.vscode-PSStackoverflow@0.0.2
eamodio.gitlens@10.0.1
formulahendry.code-runner@0.9.14
ms-vscode-remote.remote-wsl@0.39.5
ms-vscode.powershell@2019.9.0
Shan.code-settings-sync@3.4.3
Tyriar.shell-launcher@0.3.0
> code -v
1.38.1
b37e54c98e1a74ba89e03073e5a3761284e3ffb0
x64

> $PSVersionTable

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

vscode-powershell.log

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tonipohlcommented, Mar 8, 2020

Hi, I ran into the same issue yesterday, the issue suddenly appeared. I could no longer run PS commands in VSCode with the PS extension, although I tried to reconfigure it properly. My solution was to upgrade PS 6.2.x to PS 7.0. Then it worked again. dotnet tool update --global PowerShell Tool ‘powershell’ was successfully updated from version ‘6.2.3’ to version ‘7.0.0’. https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools hth! br, Toni

1reaction
OranguTechcommented, Oct 3, 2019

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

Thanks, I forgot about that GUI prompt.

I’ve verified it also works w/ PoSh 7 (Preview 4), without 6 installed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Starting Windows PowerShell
On the Start screen, type PowerShell and then click Windows PowerShell (x86). · In Server Manager, from the Tools menu, select Windows PowerShell...
Read more >
Visual Studio Code Powershell startup failure
Right click on the PowerShell extension and select "Install Another Version..." Pick version "2020.1.0". It also suggests disabling auto update.
Read more >
Fix for PowerShell Script cannot be loaded because ...
This is due to the Windows PowerShell execution policy being set to prevent untrusted scripts which can affect your Windows client ...
Read more >
PowerShell editing with Visual Studio Code
The extension works anywhere you can run VS Code and PowerShell 7 or higher. The extension also works for Windows PowerShell 5.1.
Read more >
Installing the AWS Tools for PowerShell on Windows
If you are not logged in as a user with administrator rights, open a PowerShell session as Administrator. Choose Start, and then choose...
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