1#!/usr/bin/env powershell
2# Install dotnet SDK using the official dotnet-install.ps1 script
3
4Set-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'
12
13# Download install script
14Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath"
15Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath
16
17# The SDK versions to install should be kept in sync with versions
18# installed by kokoro/linux/dockerfile/test/csharp/Dockerfile
19&$InstallScriptPath -Version 2.1.802
20&$InstallScriptPath -Version 3.1.301
21