mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Reload Env:PATH to get changes from inspec installation
Reloading Env:PATH does a better job of testing if the installation properly configured the system's PATH. Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>
This commit is contained in:
parent
5de39cb325
commit
8533998fb8
1 changed files with 4 additions and 2 deletions
|
@ -29,13 +29,15 @@ Start-Process "$package_file" /quiet -Wait
|
|||
|
||||
Write-Output "--- Testing $channel $product $version"
|
||||
|
||||
$Env:PATH = "C:\opscode\inspec\bin;${Env:PATH}"
|
||||
|
||||
Write-Output "Running verification for $product"
|
||||
|
||||
# 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")
|
||||
|
||||
# Set GEM_HOME and GEM_PATH to verify our appbundle inspec shim is correctly
|
||||
# removing them from the environment while launching from our embedded ruby.
|
||||
$Env:GEM_HOME = "C:\SHOULD_NOT_EXIST"
|
||||
$Env:GEM_PATH = "C:\SHOULD_NOT_EXIST"
|
||||
|
||||
inspec version
|
||||
If ($lastexitcode -ne 0) { Exit $lastexitcode }
|
||||
|
|
Loading…
Reference in a new issue