inspec/omnibus/omnibus-test.ps1
Jeremiah Snapp b04760b7f9 Fix omnibus-test.ps1
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>
2022-05-16 16:55:16 -04:00

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 }