Skip to content

When opening VSCode and when running PowerShell scripts, PowerShell crashes #5088

@DawnWertz

Description

@DawnWertz

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 have a fresh install of VSCode with only the PowerShell extension installed. When I open VSCode, the PowerShell terminal crashes
Error PowerShell session unavailable for debugging!.
Error PowerShell Language Server process didn't start!
Error Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.

. After the errors, a dialog box of "Couldn't find a debug adapter descriptor for debug type 'PowerShell' (extension might have failed to activate)."

LOG:
11/13/2024 1:54:01 PM [NORMAL] - Visual Studio Code: v1.95.2 64-bit on Windows 64-bit

11/13/2024 1:54:01 PM [NORMAL] - PowerShell Extension: v2024.4.0

11/13/2024 1:54:01 PM [NORMAL] - Starting 'Windows PowerShell (x64)' at: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe

11/13/2024 1:54:02 PM [NORMAL] - PowerShell process started with PID: 17892

11/13/2024 1:54:11 PM [WARNING] - PowerShell process terminated or Extension Terminal was closed, PID: 17892

11/13/2024 1:54:12 PM [ERROR] - Extension Terminal is undefined.

11/13/2024 1:54:12 PM [ERROR] - PowerShell Language Server process didn't start!

11/13/2024 1:54:52 PM [NORMAL] - Starting 'Windows PowerShell (x64)' at: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe

11/13/2024 1:54:52 PM [NORMAL] - PowerShell process started with PID: 9120

11/13/2024 1:55:22 PM [WARNING] - Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.

11/13/2024 1:58:54 PM [ERROR] - Timed out waiting for session file!

11/13/2024 1:58:55 PM [ERROR] - PowerShell Language Server process didn't start!

11/13/2024 1:58:55 PM [ERROR] - PowerShell session unavailable for debugging!

PowerShell Version

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

Visual Studio Code Version

1.95.2
x64

Extension Version

ms-vscode.powershell@2024.4.0

Steps to Reproduce

Install VSCode
Install the PowerShell extension
Open VSCode. PowerShell Terminal crashes.
Open a PowerShell Script
Run the PowerShell Script
PowerShell terminal crashes

I am able to run commands in the PowerShell terminal window prior to its crashing, I just cannot run scripts.

Visuals

No response

Logs

StartEditorServices-6044.log
StartEditorServices-16448.log
vscode-powershell.log

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions