Repository navigation
Closed
Labels
Description
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
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
> 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
Reacted by Matthew Parsons and Brad Schlintz (nmdhkr)
Activity
TylerLeonhardt commentedon Sep 30, 2019
Thanks for the info! Can you also attach the logs here so we can get a better idea of what's going on?
mohammedha commentedon Sep 30, 2019
uploaded to the original post
TylerLeonhardt commentedon Sep 30, 2019
Can you attach the other log files as well? We're looking for a
PowerShellEditorServiceslog file. Or is that the only file that appears in the directory? Please make sure you've turned onDiagnosticlogging:Also, this is not a requirement for the extension but I'm wondering - do you have PowerShell 6+ (aka PowerShell Core, aka
pwsh) installed on your machine?Bummibaer commentedon Oct 1, 2019
I have the same issue, additionaly to the log above, get:
BTW: I'm not allowed to execute unsigned scripts...
mohammedha commentedon Oct 1, 2019
Unfortunately this is the only log file available even the log level is set to Diagnostic
I have PS 5.1.18362.145 only.
TylerLeonhardt commentedon Oct 1, 2019
Mohamed Hassan (@mohammedha) do you work in an environment that is locked down via Group Policy or similar?
mohammedha commentedon Oct 2, 2019
TylerLeonhardt not really, also I am running Code as Admin.
21 remaining items
TylerLeonhardt commentedon Oct 26, 2019
This is fixed in #2238 just need to finish up that PR and then we'll do a release.
tonipohl commentedon 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
af4jm commentedon Sep 3, 2020
I've got PowerShell 7.0.3 & getting the same error as kinwolfqc & fekfoq259. Tried tonipohl's suggestion, instantly got a message that 7.0.3 was removed & reinstalled (obviously it wasn't since it finished in less than 1 second). No effect, still can't run or debug pwsh in VSCode, even though I have a pwsh terminal open in VS Code.
Mayhem93 commentedon Sep 29, 2020
Hey, first of all, sorry for commenting on a closed issue but I have something to add.
If you have WSL installed and run VScode in "wsl2 mode" you'll get this error message. I ran the "WSL 2: close connection" command the error of "powershell not found" is fixed. But I find it a bit annoying that I have to do that every time, because sometimes I work only with wsl2 mode of VScode, and sometimes with the "regular" mode in which case pwsh 7 is readily available.
rjmholt commentedon Sep 29, 2020
If you install PowerShell on the WSL side, I assume the extension works for you as normal?
It sounds like we could improve the error message when PowerShell isn't found -- I think the only reason we haven't done that is that it's surprisingly rare; PowerShell is always there on Windows, and on other platforms people are unlikely to get the extension without already having installed PowerShell.
Mayhem93 commentedon Sep 29, 2020
Rob Holt (@rjmholt) After installing wsl2 (and the vscode extension for it), it automatically defaults everything to WSL, that's why I called it a "mode". I only recently started working with wsl2 in vscode.
After removing the wsl2 connection (through the mentioned command):
After all this, it seems like vscode doesn't run in "wsl2 mode" anymore automatically, unless it's started from wsl2. These are my findings. It seems like it only does it every time initially after installing the wsl2 thingy.
PS: I dont have and not need pwsh on linux but I use it in windows, so this is my use case.