diff options
-rw-r--r-- | .expeditor/scripts/ensure-minimum-viable-hab.ps1 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/.expeditor/scripts/ensure-minimum-viable-hab.ps1 b/.expeditor/scripts/ensure-minimum-viable-hab.ps1 index b764524a24..c7c8560b86 100644 --- a/.expeditor/scripts/ensure-minimum-viable-hab.ps1 +++ b/.expeditor/scripts/ensure-minimum-viable-hab.ps1 @@ -1,6 +1,8 @@ try { [Version]$hab_version = (hab --version).split(" ")[1].split("/")[0] if ($hab_version -lt [Version]"0.85.0" ) { + # $foo = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) + # $foo.IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") Write-Host "--- :habicat: Installing the version of Habitat required" Write-Host "What version of Windows and PowerShell is this?`n" $PSVersionTable @@ -13,7 +15,7 @@ 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 + $test_output = Get-ChildItem -path c:\ -File "hab.exe" -Recurse -ErrorAction SilentlyContinue 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." } @@ -34,7 +36,7 @@ catch { 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 = Get-ChildItem -path c:\ -File "hab.exe" -Recurse + $test_output = Get-ChildItem -path c:\ -File "hab.exe" -Recurse -ErrorAction SilentlyContinue 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\" |