2019-03-11 20:03:58 +00:00
|
|
|
#!/usr/bin/env powershell
|
2020-06-30 12:53:31 +00:00
|
|
|
# Install dotnet SDK using the official dotnet-install.ps1 script
|
2019-03-11 20:03:58 +00:00
|
|
|
|
|
|
|
Set-StrictMode -Version 2
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
|
|
|
# avoid "Unknown error on a send" in Invoke-WebRequest
|
|
|
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
|
|
|
|
|
|
$InstallScriptUrl = 'https://dot.net/v1/dotnet-install.ps1'
|
|
|
|
$InstallScriptPath = Join-Path "$env:TEMP" 'dotnet-install.ps1'
|
|
|
|
|
|
|
|
# Download install script
|
|
|
|
Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath"
|
|
|
|
Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath
|
2019-11-25 19:29:47 +00:00
|
|
|
|
2020-06-30 12:53:31 +00:00
|
|
|
# The SDK versions to install should be kept in sync with versions
|
|
|
|
# installed by kokoro/linux/dockerfile/test/csharp/Dockerfile
|
2019-11-25 19:29:47 +00:00
|
|
|
&$InstallScriptPath -Version 2.1.802
|
2020-12-15 23:56:14 +00:00
|
|
|
&$InstallScriptPath -Version 5.0.102
|