Last active
February 12, 2022 00:21
-
-
Save kameshsampath/796060a806da15b39aa9569c8f8e6bcf to your computer and use it in GitHub Desktop.
The PowerShell script that can be used to download latest version of Istio analogus to https://git.io/getLatestIstio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string] $IstioVersion = "0.3.0" | |
) | |
$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio_$($IstioVersion)_win.zip" | |
$Path = Get-Location | |
$output = [IO.Path]::Combine($Path, "istio_$($IstioVersion)_win.zip”) | |
Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green | |
#Download file | |
(New-Object System.Net.WebClient).DownloadFile($url, $output) | |
# Unzip the Archive | |
Expand-Archive $output -DestinationPath $Path | |
#Set the environment variable | |
$IstioHome = [IO.Path]::Combine($Path, "istio-$($IstioVersion)") | |
[Environment]::SetEnvironmentVariable("ISTIO_HOME", "$IstioHome", "User") |
This is my updated working script for the latest version (as today):
param(
[string] $IstioVersion = "1.2.5"
)
$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio-$($IstioVersion)-win.zip"
$Path = Get-Location
$output = [IO.Path]::Combine($Path, "istio-$($IstioVersion)-win.zip")
Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green
#Download file
(New-Object System.Net.WebClient).DownloadFile($url, $output)
# Unzip the Archive
Expand-Archive $output -DestinationPath $Path
#Set the environment variable
$IstioHome = [IO.Path]::Combine($Path, "istio-$($IstioVersion)")
[Environment]::SetEnvironmentVariable("ISTIO_HOME", "$IstioHome", "User")
This is my updated working script for the latest version (as today):
param( [string] $IstioVersion = "1.2.5" ) $url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio-$($IstioVersion)-win.zip" $Path = Get-Location $output = [IO.Path]::Combine($Path, "istio-$($IstioVersion)-win.zip") Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green #Download file (New-Object System.Net.WebClient).DownloadFile($url, $output) # Unzip the Archive Expand-Archive $output -DestinationPath $Path #Set the environment variable $IstioHome = [IO.Path]::Combine($Path, "istio-$($IstioVersion)") [Environment]::SetEnvironmentVariable("ISTIO_HOME", "$IstioHome", "User")
Awsome, thanks the last script works greate.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the $url underscore changed to dash
From
$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio_$($IstioVersion)_win.zip"
to
$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio-$($IstioVersion)-win.zip"