mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
Check LASTEXITCODE is set before checking its value
This commit is contained in:
parent
d644bf9744
commit
f9abca0bd7
1 changed files with 1 additions and 1 deletions
|
|
@ -55,7 +55,7 @@ const wrapPowershellString string = `
|
|||
$exitCode = 1
|
||||
}
|
||||
|
||||
if ($LASTEXITCODE -ne $null -and $LASTEXITCODE -ne 0) {
|
||||
if ((Test-Path variable:global:LASTEXITCODE) -and $LASTEXITCODE -ne $null -and $LASTEXITCODE -ne 0) {
|
||||
$exitCode = $LASTEXITCODE
|
||||
}
|
||||
exit $exitCode
|
||||
|
|
|
|||
Loading…
Reference in a new issue