You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also the $DownloadPath variable is not used in all the correct places so changing the value assignment breaks the script. Better to provide the installation path as a parameter.
#requires -Version 3
[CmdletBinding()]
param
(
[Parameter(Position=0, HelpMessage='Specify Tools installation path')]
[ValidateNotNullOrEmpty()]
[string] $InstallPath = "C:\Tools"
)
Write-Output -InputObject "[$(Get-Date)] Status :: Set the Tools Directory $InstallPath"
New-Item -Path $InstallPath -ItemType Directory -ErrorAction SilentlyContinue > $null
Set-Location -Path $InstallPath -ErrorAction SilentlyContinue
Write-Output -InputObject "[$(Get-Date)] Status :: Download Rackspace CLI in $InstallPath"
Invoke-WebRequest -Uri 'https://ec4a542dbf90c03b9f75-b342aba65414ad802720b41e8159cf45.ssl.cf5.rackcdn.com/1.2/Windows/amd64/rack.exe' -Method Get -OutFile rack.exe
Write-Output -InputObject "[$(Get-Date)] Status :: Unblock the executable file rack.exe"
Unblock-File -Path $("$InstallPath\rack.exe")
Write-Output -InputObject "[$(Get-Date)] Status :: Permanently set the path $InstallPath to the Environment variable (Reboot required)."
[System.Environment]::SetEnvironmentVariable('Path', $env:Path + $InstallPath, [System.EnvironmentVariableTarget]::Machine)
Write-Output -InputObject "[$(Get-Date)] Status :: Temporarily set the path $InstallPath to the Environment variable for immediate use in the current powershell session"
$env:Path += ';' + $InstallPath
The text was updated successfully, but these errors were encountered:
The Rackpsace CLI Installation and Configuration documentation includes a Powershell script to download and install the binary but this has the wrong
-Uri
parameter value.Also the
$DownloadPath
variable is not used in all the correct places so changing the value assignment breaks the script. Better to provide the installation path as a parameter.The text was updated successfully, but these errors were encountered: