summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-10-20 12:44:27 +0600
committerJohn McCrae <john.mccrae@progress.com>2022-10-20 16:34:54 +0600
commit5a000dbc4b9f1afd38c06257c3c2d87da620de52 (patch)
treee6cc7c63d742fa1f87ccb6b5550528b40e6257d6
parente8e15d9fbd70a694a786b0a87ff97a7430427a3c (diff)
downloadchef-5a000dbc4b9f1afd38c06257c3c2d87da620de52.tar.gz
not finding the correct flavor of hab, updated the script to Recurse
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r--.expeditor/scripts/ensure-minimum-viable-hab.ps19
1 files changed, 7 insertions, 2 deletions
diff --git a/.expeditor/scripts/ensure-minimum-viable-hab.ps1 b/.expeditor/scripts/ensure-minimum-viable-hab.ps1
index 45729d34ec..b764524a24 100644
--- a/.expeditor/scripts/ensure-minimum-viable-hab.ps1
+++ b/.expeditor/scripts/ensure-minimum-viable-hab.ps1
@@ -3,8 +3,9 @@ try {
if ($hab_version -lt [Version]"0.85.0" ) {
Write-Host "--- :habicat: Installing the version of Habitat required"
Write-Host "What version of Windows and PowerShell is this?`n"
- Write-Host "`n"
$PSVersionTable
+ Write-Host "`n"
+ Write-Host "This is the OS Version"
[System.Environment]::OSVersion
Write-Host "What version of Hab is this? $((hab --version).split(" ")[1].split("/")[0])"
Write-Host "`n"
@@ -12,6 +13,9 @@ try {
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'))
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
+ $test_output = Get-ChildItem -path c:\ -File "hab.exe" -Recurse
+ Write-Host "Here's Hab`n"
+ Write-Host $test_output
if (-not $?) { throw "Hab version is older than 0.85 and could not update it." }
} else {
Write-Host "--- :habicat: :thumbsup: Minimum required version of Habitat already installed"
@@ -23,13 +27,14 @@ catch {
$PSVersionTable
[System.Environment]::OSVersion
Write-Host "`n"
+ Write-Host "Looking for Hab in all the wrong places"
Get-Command Hab
Write-Host "`n"
# This install fails if Hab isn't on the path when we check for the version. This ensures it is installed
Write-Host "--- :habicat: Forcing an install of habitat"
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'))
- $test_output = gci -path c:\ -File "hab.exe"
+ $test_output = Get-ChildItem -path c:\ -File "hab.exe" -Recurse
Write-Host "Here's Hab`n"
Write-Host $test_output
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") + ";C:\ProgramData\Habitat\"