From a1a20e7c86d5941f0af7d4806af873c4a1fc16f8 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Wed, 22 Jun 2022 08:10:56 +0200 Subject: [PATCH] revert(pwsh): check history id instead of command line this reverts commit e041c23fe1be034772d2b6c89733437377851cf3 resolves #2431 --- src/shell/scripts/omp.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell/scripts/omp.ps1 b/src/shell/scripts/omp.ps1 index 4511225b..68daa0f5 100644 --- a/src/shell/scripts/omp.ps1 +++ b/src/shell/scripts/omp.ps1 @@ -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