Skip to content

Running any PowerShell script crashes the terminal before it even launches #5092

@jsantoro339as

Description

@jsantoro339as

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

Once I try to run vscode and it starts the PowerShell session, it always fails. I have uninstalled all extensions, then I have completely removed vscode including deleting any leftover components. Rebooted and reinstalled vscode. Once I opened the PS1 file it asked me if I wanted to install the PowerShell extension, I did and once installed it immediately crashes and fails with the error hell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing()

My PowerShell script I am using to test is only containing the below line. get-childitem "c:\temp" -depth 0

PowerShell Version

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

Name             : ConsoleHost
Version          : 5.1.22621.4391
InstanceId       : b2ca931a-2fac-41e3-a1bb-a1fcdd2eed43
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.95.2
e8653663e8840adaf45af01eab5c627a5af81807
x64

Extension Version

ms-vscode.powershell@2024.4.0

Steps to Reproduce

I am only creating a new ps1 file and adding the below line

Get-ChildItem c;\temp -depth 0

I get the below error before I execute

Exception encountered starting EditorServices. Exception logged in C:__w\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs on line 239 in EndProcessing:
hell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing()

Visuals

image

Logs

vscode_logs.zip

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