Sydney Acksman | 15fab91 | 2019-03-11 15:03:58 -0500 | [diff] [blame] | 1 | #!/usr/bin/env powershell |
Jan Tattermusch | fed7e18 | 2020-06-30 08:53:31 -0400 | [diff] [blame] | 2 | # Install dotnet SDK using the official dotnet-install.ps1 script |
Sydney Acksman | 15fab91 | 2019-03-11 15:03:58 -0500 | [diff] [blame] | 3 | |
| 4 | Set-StrictMode -Version 2 |
| 5 | $ErrorActionPreference = 'Stop' |
| 6 | |
| 7 | # avoid "Unknown error on a send" in Invoke-WebRequest |
| 8 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 |
| 9 | |
| 10 | $InstallScriptUrl = 'https://dot.net/v1/dotnet-install.ps1' |
| 11 | $InstallScriptPath = Join-Path "$env:TEMP" 'dotnet-install.ps1' |
Sydney Acksman | 15fab91 | 2019-03-11 15:03:58 -0500 | [diff] [blame] | 12 | |
| 13 | # Download install script |
| 14 | Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath" |
| 15 | Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath |
Jan Tattermusch | 96e9ff3 | 2019-11-25 20:29:47 +0100 | [diff] [blame] | 16 | |
Jan Tattermusch | fed7e18 | 2020-06-30 08:53:31 -0400 | [diff] [blame] | 17 | # The SDK versions to install should be kept in sync with versions |
| 18 | # installed by kokoro/linux/dockerfile/test/csharp/Dockerfile |
Jan Tattermusch | 96e9ff3 | 2019-11-25 20:29:47 +0100 | [diff] [blame] | 19 | &$InstallScriptPath -Version 2.1.802 |
James Newton-King | 8932446 | 2020-12-16 12:56:14 +1300 | [diff] [blame] | 20 | &$InstallScriptPath -Version 5.0.102 |