diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 45f0b989..6fabe4cf 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -64,7 +64,7 @@ function Set-PoshPrompt { Set-PoshContext if ($lastCommandSuccess -eq $false) { #native app exit code - if ($realLASTEXITCODE -is [int]) { + if ($realLASTEXITCODE -is [int] -and $realLASTEXITCODE -gt 0) { $errorCode = $realLASTEXITCODE } else {