Skip to content

Commit b9a390a

Browse files
committed
Exit Python installation script following installation failures
Future steps may rely on the existence of Python. If Python installation fails, subsequent statements will fail. To preclude subsequent failures, the script will exit immediately following failure to install.
1 parent 6a65102 commit b9a390a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/install-python.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ function Install-Python {
5151
Write-Host "Installation completed successfully." -ForegroundColor Green
5252
} elseif ($install.ExitCode -eq 1602) {
5353
Write-Host "Installer was exited by the user." -ForegroundColor Red
54+
Exit 1
5455
} else {
5556
Write-Host "Installation failed with exit code $install.ExitCode" -ForegroundColor Red
57+
Exit 1
5658
}
5759
}
5860

0 commit comments

Comments
 (0)