Skip to content

Powershell extension never completes initializing... #4720

@ben-bluecloud

Description

@ben-bluecloud

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed 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

When starting a intergrated terminal session the extension never finishes initializing. I can use powershell outside of this terminal but without intellisense/formatting etc.

The terminial info 'hover' window shows:
PowerShell Extension

Process ID (PID): 16672

Command line: C:\Program Files\PowerShell\7\pwsh.exe '-NoProfile' '-ExecutionPolicy' 'Bypass' '-Command' 'Import-Module 'c:\Users<user>.vscode\extensions\ms-vscode.powershell-2023.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users<user>.vscode\extensions\ms-vscode.powershell-2023.6.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.6.0 Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell Type 'help' to get help. " -LogLevel 'Normal' -LogPath 'c:\Users<user>\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1693824471-40f1424a-a573-4b8a-bfc7-992a1b203df51693824469438\EditorServices.log' -SessionDetailsPath 'c:\Users<user>\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-25696-773225.json' -FeatureFlags @() '

The following extensions have contributed to this terminal's environment:

Git: Enables the following features: git auth provider`

The terminal output log for the extension only shows:
`9/4/2023 12:47:51 PM [NORMAL] - Visual Studio Code: v1.81.1 64-bit on Windows 64-bit

9/4/2023 12:47:51 PM [NORMAL] - PowerShell Extension: v2023.6.0

9/4/2023 12:47:52 PM [NORMAL] - Starting 'PowerShell_7' at: C:\Program Files\PowerShell\7\pwsh.exe

9/4/2023 12:47:54 PM [NORMAL] - PowerShell process started with PID: 16672`

Powershell editor outputlog:
`[Warn - 12:52:56 PM] OmniSharp.Extensions.LanguageServer.Server.LspServerOutputFilter: Tried to send request or notification before initialization was completed and will be sent later OmniSharp.Extensions.JsonRpc.RequestCancelled | @request='OmniSharp.Extensions.JsonRpc.RequestCancelled'

I have settings synced to a different PC and it works fine there. I have uninstalled the extension, including in the .vscode folder
I see the pid is running, but it seems that the extension never 'gets told' about it, or that some other extension process is starting/hung.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.81.1
6c3e3dba23e8fadc360aed75ce363ba185c49794
x64

Extension Version

ms-vscode.powershell@2023.6.0

Steps to Reproduce

  1. Open vs code (standard/non-admin user)
  2. Open a powershell script
  3. wait...

Visuals

image
image
image

Logs

When the terminal is closed the terminal output is shows:
9/4/2023 1:14:31 PM [VERBOSE] - Loaded settings:
{
"powerShellAdditionalExePaths": {
"PowerShell_7": "C:\Program Files\PowerShell\7\pwsh.exe",
"PowerShell": "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
},
"powerShellDefaultVersion": "PowerShell_7",
"powerShellExePath": "",
"promptToUpdatePowerShell": true,
"startAsLoginShell": {
"osx": true,
"linux": false
},
"startAutomatically": true,
"enableProfileLoading": true,
"helpCompletion": "BlockComment",
"scriptAnalysis": {
"enable": true,
"settingsPath": "PSScriptAnalyzerSettings.psd1"
},
"debugging": {
"createTemporaryIntegratedConsole": false
},
"developer": {
"featureFlags": [],
"bundledModulesPath": "../../PowerShellEditorServices/module",
"editorServicesLogLevel": "Diagnostic",
"editorServicesWaitForDebugger": false,
"waitForSessionFileTimeoutSeconds": 240
},
"codeFormatting": {
"autoCorrectAliases": true,
"avoidSemicolonsAsLineTerminators": false,
"preset": "Custom",
"openBraceOnSameLine": true,
"newLineAfterOpenBrace": true,
"newLineAfterCloseBrace": true,
"pipelineIndentationStyle": "NoIndentation",
"whitespaceBeforeOpenBrace": true,
"whitespaceBeforeOpenParen": true,
"whitespaceAroundOperator": true,
"whitespaceAfterSeparator": true,
"whitespaceBetweenParameters": false,
"whitespaceInsideBrace": true,
"addWhitespaceAroundPipe": true,
"trimWhitespaceAroundPipe": true,
"ignoreOneLineBlock": true,
"alignPropertyValuePairs": true,
"useConstantStrings": false,
"useCorrectCasing": false
},
"integratedConsole": {
"showOnStartup": true,
"startInBackground": false,
"focusConsoleOnExecute": true,
"useLegacyReadLine": false,
"forceClearScrollbackBuffer": false,
"suppressStartupBanner": false
},
"sideBar": {
"CommandExplorerVisibility": true,
"CommandExplorerExcludeFilter": []
},
"pester": {
"useLegacyCodeLens": true,
"outputVerbosity": "FromPreference",
"debugOutputVerbosity": "Diagnostic"
},
"buttons": {
"showRunButtons": true,
"showPanelMovementButtons": false
},
"cwd": "c:\Dev\VSC\Repos++Projects++\project\project",
"enableReferencesCodeLens": true,
"analyzeOpenDocumentsOnly": false
}

9/4/2023 1:14:31 PM [VERBOSE] - Creating log directory at: 'file:///c%3A/Users//AppData/Roaming/Code/User/globalStorage/ms-vscode.powershell/logs/1693826071-b016fe0c-aa75-41a2-8566-d3244cdae8c61693826024286'

9/4/2023 1:14:31 PM [NORMAL] - Visual Studio Code: v1.81.1 64-bit on Windows 64-bit

9/4/2023 1:14:31 PM [NORMAL] - PowerShell Extension: v2023.6.0

9/4/2023 1:14:31 PM [VERBOSE] - Session status changing from 'Not Started' to 'Starting'.

9/4/2023 1:14:31 PM [VERBOSE] - Finding PowerShell...

9/4/2023 1:14:31 PM [NORMAL] - Starting 'PowerShell_7' at: C:\Program Files\PowerShell\7\pwsh.exe

9/4/2023 1:14:31 PM [VERBOSE] - Starting process: C:\Program Files\PowerShell\7\pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users.vscode\extensions\ms-vscode.powershell-2023.6.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2023.6.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users.vscode\extensions\ms-vscode.powershell-2023.6.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2023.6.0
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Diagnostic' -LogPath 'c:\Users\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1693826071-b016fe0c-aa75-41a2-8566-d3244cdae8c61693826024286\EditorServices.log' -SessionDetailsPath 'c:\Users\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-29264-104885.json' -FeatureFlags @()

9/4/2023 1:14:32 PM [NORMAL] - PowerShell process started with PID: 29800

9/4/2023 1:14:32 PM [VERBOSE] - Waiting for session file: file:///c%3A/Users//AppData/Roaming/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-29264-104885.json

9/4/2023 1:14:33 PM [VERBOSE] - Session file found.

9/4/2023 1:14:33 PM [VERBOSE] - Session details: {
"status": "started",
"languageServiceTransport": "NamedPipe",
"languageServicePipeName": "\.\pipe\PSES_mclz1pls.f3n",
"debugServiceTransport": "NamedPipe",
"debugServicePipeName": "\.\pipe\PSES_uy1w1z3b.a2z",
"powerShellVersion": "7.3.6"
}

9/4/2023 1:14:33 PM [VERBOSE] - Connecting to language service...

9/4/2023 1:14:33 PM [VERBOSE] - Language service connected.

9/4/2023 1:26:40 PM [WARNING] - PowerShell process terminated or Extension Terminal was closed, PID: 29800

9/4/2023 1:26:41 PM [ERROR] - Never finished startup!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions