diff --git a/scripts/Invoke-CodeGen.ps1 b/scripts/Invoke-CodeGen.ps1 index 20f84eb12..afc4f58d5 100644 --- a/scripts/Invoke-CodeGen.ps1 +++ b/scripts/Invoke-CodeGen.ps1 @@ -32,7 +32,12 @@ function Invoke-ScriptWithLogging { $scriptString = $Script | Out-String Write-Host "--------------------------------------------------------------------------------`n> $scriptString" & $Script + $exitCode = $LASTEXITCODE Write-Host "" + + if ($exitCode -ne 0) { + throw "Command failed with exit code $exitCode" + } }