Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The PowerShell script that can be used to download latest version of Istio analogus to https://git.io/getLatestIstio
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")
@rohanmeh

This comment has been minimized.

Copy link

rohanmeh commented Jun 17, 2019

Hi, in case anyone else is facing the same issue, I was getting this error when I tried to run the script:

Exception calling "DownloadFile" with "2" argument(s): "The request was aborted: Could not create SSL/TLS secure
channel."

But I was able to fix it with the solution here: Requarks/wiki#421,
Adding [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" to the top of the file fixed the issue.

@kametepe

This comment has been minimized.

Copy link

kametepe commented Aug 16, 2019

had to fix the ending double quote
from
$output = [IO.Path]::Combine($Path, "istio_$($IstioVersion)win.zip”)
to
$output = [IO.Path]::Combine($Path, "istio
$($IstioVersion)_win.zip")

@ale206

This comment has been minimized.

Copy link

ale206 commented Aug 27, 2019

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")
@Chugarah

This comment has been minimized.

Copy link

Chugarah commented Oct 1, 2019

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
You can’t perform that action at this time.