Vscode-powershell: Debug Session Crashing

Created on 24 Feb 2021  路  5Comments  路  Source: PowerShell/vscode-powershell

System Details


System Details Output

PS C:\Users\admin> & {"### VSCode version: $(code -v)"; "`n### VSCode extensions:`n$(code --list-extensions --show-versions | Out-String)"; "`n### PSES version: $($pseditor.EditorServicesVersion)"; "`n### PowerShell version:`n$($PSVersionTable | Out-String)"}
>> 

### VSCode version: 1.53.2 622cb03f7e070a9670c94bae1a45d78d7181fbd4 x64

### VSCode extensions:
[email protected]
[email protected]   
[email protected]        
[email protected]


### PSES version: 2.3.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.1.2
PSEdition                      Core
GitCommitId                    7.1.2
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Description

While debugging my PowerShell script. I am occasionally witnessing a crash, even without breakpoints.

The terminal process "C:\Program Files\PowerShell\7\pwsh.exe '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', 'Import-Module 'c:\Users\Admin\.vscode\extensions\ms-vscode.powershell-preview-2020.9.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.9.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\Admin\.vscode\extensions\ms-vscode.powershell-preview-2020.9.0\modules' -EnableConsoleRepl -StartupBanner '=====> PowerShell Preview Integrated Console v2020.9.0 <=====
' -LogLevel 'Normal' -LogPath 'c:\Users\Admin\.vscode\extensions\ms-vscode.powershell-preview-2020.9.0\logs\1614183831-e2d954c4-63bd-4c5c-af23-38fe0cbdf90c1613690344185\EditorServices.log' -SessionDetailsPath 'c:\Users\Admin\.vscode\extensions\ms-vscode.powershell-preview-2020.9.0\sessions\PSES-VSCode-15944-887475' -FeatureFlags @() '" terminated with exit code: 3762504530.

Expected Behaviour

Code should run all the way through without crashing the PowerShell terminal window.

Actual Behaviour

I receive the error above & have to restart the PowerShell extension in VSCode.

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

Needs-Repro-Info Resolution - Inactive

Most helpful comment

@andschwa I've followed your instructions. Will report back if i'm still getting errors during debugging.
@SydneyhSmith I'm using neither to my knowledge. Also, I no longer have untitled15.ps1 in my active code window.

All 5 comments

Hi @rileysea,

Could you please try uninstall both the PowerShell and PowerShell Preview extensions, restarting Visual Studio Code, and then installing the PowerShell Preview extension again?

I ask because I see a discrepancy in your posted versions. It looks like you have both the "stable" and "preview" versions installed (generally not recommended), and that you recently updated the preview to yesterday's release: [email protected], but your issue description shows in its log the older September preview ms-vscode.powershell-preview-2020.9.0.

It would also be great to know if you are running in StrictMode and/or using an $ErrorActionPreference....
I also noticed this in the logs:
2021-02-24 10:46:27.807 -06:00 [WRN] Failed to get file for fileUri: 'untitled:Untitled-15'
Is Untitled-15 a saved .ps1 file?

@andschwa I've followed your instructions. Will report back if i'm still getting errors during debugging.
@SydneyhSmith I'm using neither to my knowledge. Also, I no longer have untitled15.ps1 in my active code window.

This issue is being closed as inactive, if this issue is still occurring it will be re-opened

Was this page helpful?
0 / 5 - 0 ratings