mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Updates habitat test for windows to match install logic for linux
Signed-off-by: Collin McNeese <cmcneese@chef.io>
This commit is contained in:
parent
730be6c92f
commit
7b5b5db3ab
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