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
The execution status for the last command is being incorrectly reported in the $? automatic variable when using the PowerShell Extension. While using PowerShell in Visual Studio code, the execution status is reported properly by $?.
As an aside, getting the ExecutionStatus via Get-History | Select Id,ExecutionStatus,CommandLine seems to always report 'Completed' even after encountering a "command not recognized" type of error.
Tagging @SeeminglyScience per his request via the PowerShell community Discord.
Prerequisites
Summary
The execution status for the last command is being incorrectly reported in the $? automatic variable when using the PowerShell Extension. While using PowerShell in Visual Studio code, the execution status is reported properly by $?.
As an aside, getting the ExecutionStatus via
Get-History | Select Id,ExecutionStatus,CommandLine
seems to always report 'Completed' even after encountering a "command not recognized" type of error.Tagging @SeeminglyScience per his request via the PowerShell community Discord.
PowerShell Version
Visual Studio Code Version
Extension Version
Steps to Reproduce
Open the VS Code terminal with the PowerShell extension. Run:
FakeCommand $?
Then switch to PowerShell in the VS Code terminal or in Windows Terminal and run the same command.
In the PowerShell extension, it returns
True
.In PowerShell, it returns
False
.Visuals
Logs
No response
The text was updated successfully, but these errors were encountered: