Skip to content

Extension does not load WindowsPowerShell 5.1 #4442

@brwilkinson

Description

@brwilkinson

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

I don't normally use WindowsPowerShell, however I have a Module that depends on it. I tried this with other colleagues and they are also blocked on the startup.

D:\Repos\PowerShellEditorServices\src\PowerShellEditorServices.Hosting\Configuration\TransportConfig.cs

appears to be blocked on this await

        public async Task<(Stream inStream, Stream outStream)> ConnectStreamsAsync()
        {
            _logger.Log(PsesLogLevel.Diagnostic, "Creating named pipe");
            NamedPipeServerStream namedPipe = NamedPipeUtils.CreateNamedPipe(_pipeName, PipeDirection.InOut);
            _logger.Log(PsesLogLevel.Diagnostic, "Waiting for named pipe connection");
            await namedPipe.WaitForConnectionAsync().ConfigureAwait(false);
            _logger.Log(PsesLogLevel.Diagnostic, "Named pipe connected");
            return (namedPipe, namedPipe);
        }

image

image

D:\Repos\PowerShellEditorServices\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs

EndProcessing()

image

PowerShell Version

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.25309.1000
PSEdition                      Desktop

Visual Studio Code Version

code --version
1.76.0
92da9481c0904c6adfe372c12da3b7748d74bdcb
x64

Extension Version

code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2023.2.1
ms-vscode.powershell-preview@2023.2.1     (disabled)

Steps to Reproduce

open vscode and open a powershell script, the extension is frozen on startup

Visuals

No response

Logs

DEBUG: Logging started
DEBUG: Beginning EndProcessing block
VERBOSE: Removing PSReadLine
DEBUG: Creating host configuration
DEBUG: Determining REPL kind
DEBUG: REPL configured as PSReadLine
DEBUG: Configuring LSP transport
DEBUG: Configuring debug transport
DEBUG: Session file writer created
VERBOSE: Adding AssemblyResolve event handler for dependency loading
VERBOSE: Loading EditorServices
VERBOSE: PID: 11676
VERBOSE:
== Build Details ==

  • Editor Services version: 3.8.1

  • Build origin: Release

  • Build commit: 016f1300cb4230cf71536cf3d4f0a4096e4ad23e

  • Build time: 2/13/2023 12:00:00 AM
    VERBOSE:
    == Host Startup Configuration Details ==

  • Host name: Visual Studio Code Host

  • Host version: 2023.2.1

  • Host profile ID: Microsoft.VSCode

  • PowerShell host type: System.Management.Automation.Internal.Host.InternalHost

  • REPL setting: PSReadLine

  • Session details path:
    c:\Users\benwilk\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-18596-964711.json

  • Bundled modules path: c:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules

  • Additional modules: PowerShellEditorServices.VSCode

  • Feature flags:

  • Log path:
    c:\Users\benwilk\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1677889372-192e9495-26f0-4991-a542-8ddab5c952b516778893563
    59\EditorServices.log

  • Minimum log level: Diagnostic

  • Profile paths:

    • AllUsersAllHosts: C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
    • AllUsersCurrentHost: C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.VSCode_profile.ps1
    • CurrentUserAllHosts: D:\OneDrive\Documents\WindowsPowerShell\profile.ps1
    • CurrentUserCurrentHost: D:\OneDrive\Documents\WindowsPowerShell\Microsoft.VSCode_profile.ps1
      DEBUG: Loaded 'Microsoft.PowerShell.Commands.Diagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' from
      'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Diagnostics\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Com
      mands.Diagnostics.dll'
      DEBUG: Loaded 'System.Configuration.Install, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' from
      'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration.Install\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.Install.dll'
      DEBUG: Loaded 'Microsoft.PowerShell.Commands.Utility, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' from
      'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Command
      s.Utility.dll'
      DEBUG: Loaded 'Microsoft.PowerShell.Commands.Management, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' from
      'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.PowerShell.Comm
      ands.Management.dll'
      DEBUG: Loaded 'Microsoft.WSMan.Management, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' from
      'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.WSMan.Management\v4.0_3.0.0.0__31bf3856ad364e35\Microsoft.WSMan.Management.dll'
      DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Security.resources, Version=3.0.0.0, Culture=en-US,
      PublicKeyToken=31bf3856ad364e35
      DEBUG: Assembly resolve event fired for Microsoft.PowerShell.Security.resources, Version=3.0.0.0, Culture=en-US,
      PublicKeyToken=31bf3856ad364e35
      DEBUG: Assembly resolve event fired for Microsoft.WSMan.Management.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35
      DEBUG: Assembly resolve event fired for Microsoft.WSMan.Management.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35
      DEBUG: Assembly resolve event fired for Microsoft.PowerShell.EditorServices, Version=3.8.1.0, Culture=neutral, PublicKeyToken=null
      VERBOSE:
      == Console Details ==
  • Console input encoding: OEM United States

  • Console output encoding: OEM United States

  • PowerShell output encoding: US-ASCII
    DEBUG: Loading Microsoft.PowerShell.EditorServices, Version=3.8.1.0, Culture=neutral, PublicKeyToken=null from PSES dependency dir into
    LoadFile context
    VERBOSE:
    == PowerShell Details ==

  • PowerShell version: 5.1.25309.1000

  • Language mode: FullLanguage
    DEBUG: Loaded 'Microsoft.PowerShell.EditorServices, Version=3.8.1.0, Culture=neutral, PublicKeyToken=null' from
    'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Microsoft.PowerShell.EditorSer
    vices.dll'
    DEBUG: Loaded 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' from
    'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.RuntimeInformation\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.I
    nteropServices.RuntimeInformation.dll'
    VERBOSE:
    == Environment Details ==

  • OS description: Microsoft Windows 10.0.25309

  • OS architecture: X64

  • Process bitness: 64
    DEBUG: Loaded 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' from
    'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51\netstandard.dll'
    DEBUG: Checking that .NET Framework version is at least 4.6.2
    VERBOSE: .NET registry version: 533320
    VERBOSE: Updated PSModulePath to: 'D:\OneDrive\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program
    files\powershell\7-preview\Modules;D:\OneDrive\Documents\WindowsPowerShell\Modules;C:\Program
    Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft Azure Information
    Protection\Powershell;c:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules'
    DEBUG: Assembly resolve event fired for Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral,
    PublicKeyToken=adb9793829ddae60
    DEBUG: Validating configuration
    VERBOSE: Loading PowerShell Editor Services
    VERBOSE: Starting EditorServices
    DEBUG: Assembly resolve event fired for Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
    DEBUG: Loading Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 from PSES
    dependency dir into LoadFile context
    DEBUG: Loading Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 from PSES dependency dir into
    LoadFile context
    DEBUG: Loaded 'Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' from
    'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Microsoft.Extensions.Logging.A
    bstractions.dll'
    DEBUG: Loaded 'Microsoft.Extensions.Logging, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' from
    'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Microsoft.Extensions.Logging.d
    ll'
    DEBUG: Assembly resolve event fired for Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
    DEBUG: Loading Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10 from PSES dependency dir into LoadFile context
    DEBUG: Assembly resolve event fired for OmniSharp.Extensions.LanguageServer, Version=0.19.0.0, Culture=neutral,
    PublicKeyToken=6d868dff454e6022
    DEBUG: Loaded 'Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10' from
    'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Serilog.dll'
    DEBUG: Assembly resolve event fired for Serilog.Sinks.Async, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
    DEBUG: Loading OmniSharp.Extensions.LanguageServer, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022 from PSES dependency
    dir into LoadFile contextDEBUG: Loading Serilog.Sinks.Async, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10 from PSES dependency dir into LoadFile
    context

DEBUG: Loaded 'Serilog.Sinks.Async, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Serilog.Sinks.Async.dll'
DEBUG: Loaded 'OmniSharp.Extensions.LanguageServer, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.LanguageS
erver.dll'
DEBUG: Assembly resolve event fired for Serilog.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Assembly resolve event fired for OmniSharp.Extensions.JsonRpc, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022
DEBUG: Loading Serilog.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10 from PSES dependency dir into
LoadFile context
DEBUG: Loading OmniSharp.Extensions.JsonRpc, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022 from PSES dependency dir into
LoadFile context
DEBUG: Loaded 'Serilog.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Serilog.Extensions.Logging.dll
'
DEBUG: Assembly resolve event fired for Microsoft.Extensions.Logging.Abstractions, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=adb9793829ddae60
DEBUG: Loading Microsoft.Extensions.Logging.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 from PSES
dependency dir into LoadFile context
DEBUG: Loaded 'OmniSharp.Extensions.JsonRpc, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.JsonRpc.d
ll'
DEBUG: Assembly resolve event fired for Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10
DEBUG: Loading Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10 from PSES dependency dir into LoadFile
context
DEBUG: Loaded 'Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Serilog.Sinks.File.dll'
DEBUG: Assembly resolve event fired for MediatR, Version=8.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2
DEBUG: Loading MediatR, Version=8.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2 from PSES dependency dir into LoadFile context
DEBUG: Assembly resolve event fired for Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loading Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 from PSES dependency dir into
LoadFile context
DEBUG: Loaded 'MediatR, Version=8.0.0.0, Culture=neutral, PublicKeyToken=bb9a41a5e8aaa7e2' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\MediatR.dll'
DEBUG: Loaded 'Microsoft.Extensions.Options, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Microsoft.Extensions.Options.d
ll'
DEBUG: Assembly resolve event fired for OmniSharp.Extensions.LanguageProtocol, Version=0.19.0.0, Culture=neutral,
PublicKeyToken=6d868dff454e6022
DEBUG: Loading OmniSharp.Extensions.LanguageProtocol, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022 from PSES dependency
dir into LoadFile context
DEBUG: Loaded 'OmniSharp.Extensions.LanguageProtocol, Version=0.19.0.0, Culture=neutral, PublicKeyToken=6d868dff454e6022' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.LanguageP
rotocol.dll'
DEBUG: Assembly resolve event fired for Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
DEBUG: Assembly resolve event fired for Microsoft.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
DEBUG: Loading Microsoft.Extensions.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 from PSES dependency dir into
LoadFile context
DEBUG: Loading Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed from PSES dependency dir into LoadFile
context
DEBUG: Loaded 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' from
'C:\Users\benwilk.vscode\extensions\ms-vscode.powershell-2023.2.1\modules\PowerShellEditorServices\bin\Common\Newtonsoft.Json.dll'
DEBUG: Creating/running editor services
DEBUG: Creating startup info object
VERBOSE: Starting server, deregistering host logger and registering shutdown listener

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions