-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Get-Error populates $Error variable #11228
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.
Description
Steps to reproduce
Open a new pwsh
$Error
Get-Process blah
$Error
Get-Error
$ErrorExpected behavior
$Error # no output expected
Get-Process blah
$Error # previous and only one error in output
Get-Error # gets the previous error in detailed error output
$Error # only one error in output expected
Actual behavior
$Error # no output expected
Get-Process blah
$Error # previous and only one error in output
Get-Error # gets the previous error in detailed error output
$Error # actual error and Get-Error output both captured in this variable
Environment data
Name Value
---- -----
PSVersion 7.0.0-preview.6
PSEdition Core
GitCommitId 7.0.0-preview.6
OS Microsoft Windows 10.0.19033
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.