You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Summary
When throwing an exception (terminating error) from a script or command-line, the output in Integrated Console shows some internal stack trace, instead of the actual exception message.
PS>throw "Test"
An error occurred while running the REPL loop:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Microsoft.PowerShell.EditorServices.Utility.PSCommandHelpers.MergePipelineResults(PSCommand psCommand) in D:\a\1\s\src\PowerShellEditorServices\Utility\PSCommandExtensions.cs:line 65
at Microsoft.PowerShell.EditorServices.Utility.PSCommandHelpers.AddOutputCommand(PSCommand psCommand) in D:\a\1\s\src\PowerShellEditorServices\Utility\PSCommandExtensions.cs:line 51
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.ExecuteNormally(CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 106
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.Run(CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 55
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteSynchronously(CancellationToken executorCancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 92
--- End of stack trace from previous location ---
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.get_Result() in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 60
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteAndGetResult(CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 109
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokePSCommand[TResult](PSCommand psCommand, PowerShellExecutionOptions executionOptions, CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 376
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokePSCommand(PSCommand psCommand, PowerShellExecutionOptions executionOptions, CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 380
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokeInput(String input, CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 674
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.DoOneRepl(CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 636
The release version yields the expected result:
PS>throw "Test"
Exception: Test
PowerShell Version
PS>$PSVersionTable Name Value---- -----PSVersion 7.2.1PSEdition CoreGitCommitId 7.2.1OS Microsoft Windows 10.0.19042Platform Win32NTPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3SerializationVersion 1.1.0.1WSManStackVersion 3.0
Prerequisites
Summary
When throwing an exception (terminating error) from a script or command-line, the output in Integrated Console shows some internal stack trace, instead of the actual exception message.
The release version yields the expected result:
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Throw an exception
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: