mirror of
https://github.com/inspec/inspec
synced 2024-11-26 14:40:26 +00:00
Merge pull request #5718 from collinmcneese/cm/hab_artifact_tests
Updates habitat test for windows to match install logic for linux
This commit is contained in:
commit
03476d70b8
1 changed files with 9 additions and 6 deletions
|
@ -15,12 +15,15 @@ $Properties = 'Caption', 'CSName', 'Version', 'BuildType', 'OSArchitecture'
|
|||
Get-CimInstance Win32_OperatingSystem | Select-Object $Properties | Format-Table -AutoSize
|
||||
|
||||
Write-Host "--- Installing the version of Habitat required"
|
||||
$hab_version = (hab --version)
|
||||
$hab_minor_version = $hab_version.split('.')[1]
|
||||
if ( -not $? -Or $hab_minor_version -lt 85 ) {
|
||||
Install-Habitat --version 0.85.0.20190916
|
||||
} else {
|
||||
Write-Host ":habicat: I think I have the version I need to build."
|
||||
try {
|
||||
hab --version
|
||||
}
|
||||
catch {
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force
|
||||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.ps1'))
|
||||
}
|
||||
finally {
|
||||
Write-Host ":habicat: I think I have the version I need to build."
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue