blob: f9dc0d9d7ac38ec7b4565c10dcb0df78aeb3b5e1 [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
James Newton-Kingaa159312021-11-10 08:49:53 +130019&$InstallScriptPath -Version 3.1.415
20&$InstallScriptPath -Version 6.0.100