Get stricter about error handling in powershell.

Still doesn't do anything about subcmds failing. Those have to be
manually checked.

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2020-02-11 15:24:27 -08:00
parent b557eaff7e
commit 3c9c2b4b1f
2 changed files with 8 additions and 0 deletions

3
.expeditor/buildkite/artifact.habitat.test.ps1 Normal file → Executable file
View file

@ -1,6 +1,9 @@
#!/usr/bin/env powershell
#Requires -Version 5
# https://stackoverflow.com/questions/9948517
Set-StrictMode -Version Latest
$PSDefaultParameterValues['*:ErrorAction']='Stop'
$ErrorActionPreference = 'Stop'
$env:HAB_ORIGIN = 'ci'
$env:CHEF_LICENSE = 'accept-no-persist'

View file

@ -1,3 +1,8 @@
# https://stackoverflow.com/questions/9948517
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'
$pkg_name="inspec"
$pkg_origin="chef"
$pkg_version=$(Get-Content "$PLAN_CONTEXT/../VERSION")