fix(pwsh): set lastCommandSuccess first

resolves #849
This commit is contained in:
Jan De Dobbeleer 2021-07-12 07:35:08 +02:00 committed by Jan De Dobbeleer
parent 2aa00da41b
commit 07b9b82f9f

View file

@ -67,6 +67,10 @@ function global:Initialize-ModuleSupport {
}
[ScriptBlock]$Prompt = {
#store if the last command was successful
$lastCommandSuccess = $?
#store the last exit code for restore
$realLASTEXITCODE = $global:LASTEXITCODE
$omp = "::OMP::"
$config, $cleanPWD, $cleanPSWD = Get-PoshContext
if ($global:PoshSettings.Transient -eq $true) {
@ -75,10 +79,6 @@ function global:Initialize-ModuleSupport {
$global:PoshSettings.Transient = $false
return
}
#store if the last command was successful
$lastCommandSuccess = $?
#store the last exit code for restore
$realLASTEXITCODE = $global:LASTEXITCODE
$errorCode = 0
Initialize-ModuleSupport
Set-PoshContext