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:
Clinton Wolfe 2021-11-12 23:33:30 -05:00 committed by GitHub
commit 03476d70b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,11 +15,14 @@ $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 {
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."
}