diff options
author | John McCrae <john.mccrae@progress.com> | 2022-10-20 15:36:14 +0600 |
---|---|---|
committer | John McCrae <john.mccrae@progress.com> | 2022-10-20 16:34:54 +0600 |
commit | ca66e97d60a946c2e74582676d9eda223bae353d (patch) | |
tree | 490b8241ed162f7e640739291768b6a0c639e328 | |
parent | 5a000dbc4b9f1afd38c06257c3c2d87da620de52 (diff) | |
download | chef-ca66e97d60a946c2e74582676d9eda223bae353d.tar.gz |
Adding -ErrorAction SilentlyContinue
Signed-off-by: John McCrae <john.mccrae@progress.com>
-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\" |