blob: c78655cc027ea6c50058165306af274f165d3f6f [file] [log] [blame]
Sydney Acksman15fab912019-03-11 15:03:58 -05001#!/usr/bin/env powershell
Jan Tattermuschfed7e182020-06-30 08:53:31 -04002# Install dotnet SDK using the official dotnet-install.ps1 script
Sydney Acksman15fab912019-03-11 15:03:58 -05003
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'
Sydney Acksman15fab912019-03-11 15:03:58 -050012
13# Download install script
14Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath"
15Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath
Jan Tattermusch96e9ff32019-11-25 20:29:47 +010016
Jan Tattermuschfed7e182020-06-30 08:53:31 -040017# The SDK versions to install should be kept in sync with versions
18# installed by kokoro/linux/dockerfile/test/csharp/Dockerfile
Jan Tattermusch96e9ff32019-11-25 20:29:47 +010019&$InstallScriptPath -Version 2.1.802
James Newton-King89324462020-12-16 12:56:14 +130020&$InstallScriptPath -Version 5.0.102