revert(pwsh): check history id instead of command line

this reverts commit e041c23fe1

resolves #2431
This commit is contained in:
Jan De Dobbeleer 2022-06-22 08:10:56 +02:00 committed by Jan De Dobbeleer
parent 82b83d1fa4
commit a1a20e7c86

View file

@ -280,7 +280,7 @@ Example:
$global:Error[0] | Where-Object { $_ -ne $null } | Select-Object -ExpandProperty InvocationInfo
} catch { $null }
# check if the last command caused the last error
if ($null -ne $invocationInfo -and $script:LastHistoryId -eq $invocationInfo.HistoryId) {
if ($null -ne $invocationInfo -and $lastHistory.CommandLine -eq $invocationInfo.Line) {
$script:ErrorCode = 1
} elseif ($realLASTEXITCODE -is [int] -and $realLASTEXITCODE -ne 0) {
# native app exit code