vscode-powershell: Windows Powershell (x64) Session will not start - seems like #118289
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.
- If this is a security issue, I have read the security issue reporting guidance.
Summary
My issue is that the Windows PowerShell Session (x64) will not finish loading/launching. 32bit will load, but does not have access to 64bit tools. I have installed the last December version and the Windows PowerShell Session (x64) successfully loaded, 2022.5.0 did not load the powershell session. I even changed “set ELECTRON_RUN_AS_NODE=1” to 0, Below are the logs for the extension service.
PowerShell Version
Name Value
---- -----
PSVersion 5.1.19041.1682
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1682
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Visual Studio Code Version
1.67.2
c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
x64
Extension Version
ms-vscode.powershell@2022.5.1
Steps to Reproduce
open VS Code and open/create a ps1 file to get the extension to load.
Visuals
No response
Logs
6/7/2022 2:42:20 PM [NORMAL] - Language server starting – 6/7/2022 2:42:20 PM [NORMAL] - PowerShell executable: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe 6/7/2022 2:42:20 PM [NORMAL] - WARNING: In development mode but PowerShellEditorServices dev module path cannot be found (or has not been built yet): c:\Users\re1.vscode\extensions\PowerShellEditorServices\module
6/7/2022 2:42:20 PM [NORMAL] - PowerShell args: -NoProfile -ExecutionPolicy Bypass -Command Import-Module ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1’; Start-EditorServices -HostName ‘Visual Studio Code Host’ -HostProfileId ‘Microsoft.VSCode’ -HostVersion ‘2022.5.1’ -AdditionalModules @(‘PowerShellEditorServices.VSCode’) -BundledModulesPath ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\modules’ -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2022.5.1 <===== ’ -LogLevel ‘Normal’ -LogPath ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\logs\1654630940-2a4fc57d-2bd6-4f0f-8f6d-a94ae1f80f271654630932896\EditorServices.log’ -SessionDetailsPath ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\sessions\PSES-VSCode-20164-991690’ -FeatureFlags @() 6/7/2022 2:42:20 PM [NORMAL] - Waiting for session file 6/7/2022 2:42:20 PM [NORMAL] - powershell.exe started. 6/7/2022 2:42:20 PM [NORMAL] - PowerShell Editor Services args: Import-Module ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1’; Start-EditorServices -HostName ‘Visual Studio Code Host’ -HostProfileId ‘Microsoft.VSCode’ -HostVersion ‘2022.5.1’ -AdditionalModules @(‘PowerShellEditorServices.VSCode’) -BundledModulesPath ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\modules’ -EnableConsoleRepl -StartupBanner '=====> PowerShell Integrated Console v2022.5.1 <===== ’ -LogLevel ‘Normal’ -LogPath ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\logs\1654630940-2a4fc57d-2bd6-4f0f-8f6d-a94ae1f80f271654630932896\EditorServices.log’ -SessionDetailsPath ‘c:\Users\re1.vscode\extensions\ms-vscode.powershell-2022.5.1\sessions\PSES-VSCode-20164-991690’ -FeatureFlags @() 6/7/2022 2:42:22 PM [NORMAL] - Session file found 6/7/2022 2:42:22 PM [NORMAL] - Registering terminal close callback 6/7/2022 2:42:22 PM [NORMAL] - Registering terminal PID log callback 6/7/2022 2:42:22 PM [NORMAL] - Language server started. 6/7/2022 2:42:22 PM [NORMAL] - powershell.exe PID: 9100 6/7/2022 2:42:22 PM [NORMAL] - Connecting to language service on pipe \.\pipe\PSES_hltubtat.brd… 6/7/2022 2:42:22 PM [NORMAL] - {“status”:“started”,“languageServiceTransport”:“NamedPipe”,“languageServicePipeName”:“\\.\pipe\PSES_hltubtat.brd”,“debugServiceTransport”:“NamedPipe”,“debugServicePipeName”:“\\.\pipe\PSES_3mf5vomg.hfa”} 6/7/2022 2:42:22 PM [NORMAL] - Language service connected. 6/7/2022 2:47:23 PM [WARNING] - Invalid Version: null
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 47 (13 by maintainers)
Thanks, this workaround works for me.
However, with that said, I am still wondering what’s the root cause is and hope it can be solved. Removing staff from environment variable doesn’t seems to be a good permanant solution.
It worked for me so thank you @mrjcap worked flawlessly for me !!! Finally back up and running!
I have fixed this by chance. OneDrive corrupted somehow a file from Documents folder: C:\Users<YOUR_USER_NAME>\OneDrive \Documents\WindowsPowerShell\Modules\PackageManagement\1.4.7. Once I ran command chkdsk on C drive, everything was fine. Hope it helps.
@andschwa,
I changed the powerShellDefaultVersion to PowerShell Core and now it seems that I cannot reproduce the issue.
Thanks, but still doesn’t work for me. Downgrading extension to 2021.12.0 make it works again.
Hopefully with this information we may be able to reproduce the problem locally, which is 90% of fixing it.
I had the same issue (powershell 7.2.4) for several days and I decided to dig a little deeper.
In my case, when I was starting vscode, pwsh.exe was creating a child process of powershell.exe
After hours of troubleshooting, reinstalling, and reconfiguring pretty much everything. I still couldn’t figure out what causing the powershell.exe process to launch.
Finally, I removed the following path from the environment variables: C:\Windows\System32\WindowsPowerShell\v1.0\ from PATH. And: %SystemRoot%\system32\WindowsPowerShell\v1.0\Modules from PSModulePath.
Then I was able to start the integrated console successfully.
Another thing I noticed when I did a trace with procmon. There was a lot of activity (37000 read operations) with the StartupProfileData-Interactive file.
Update: There was a new version of VSCode that was available, 1.68.0. That seems to have cleared up the issue with the x64 session starting. Hopefully 1.68.1 does not make the issue recur.