mirror of
https://github.com/inspec/inspec
synced 2024-11-26 22:50:36 +00:00
b04760b7f9
Use Throw instead of Exit to ensure the CI job fails when a command has a non-zero exit code. Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>
12 lines
530 B
PowerShell
12 lines
530 B
PowerShell
# Stop script execution when a non-terminating error occurs
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
# reload Env:PATH to ensure it gets any changes that the install made (e.g. C:\opscode\inspec\bin\ )
|
|
$Env:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
|
|
$Env:Path = "C:\opscode\inspec\bin;C:\opscode\inspec\embedded\bin;$Env:PATH"
|
|
Write-Host "+++ Testing $Plan"
|
|
|
|
Set-Location test/artifact
|
|
rake
|
|
If ($lastexitcode -ne 0) { Throw $lastexitcode }
|