1*1b3f573fSAndroid Build Coastguard Worker #!/usr/bin/env powershell 2*1b3f573fSAndroid Build Coastguard Worker # Install dotnet SDK using the official dotnet-install.ps1 script 3*1b3f573fSAndroid Build Coastguard Worker 4*1b3f573fSAndroid Build Coastguard Worker Set-StrictMode -Version 2 5*1b3f573fSAndroid Build Coastguard Worker $ErrorActionPreference = 'Stop' 6*1b3f573fSAndroid Build Coastguard Worker 7*1b3f573fSAndroid Build Coastguard Worker # avoid "Unknown error on a send" in Invoke-WebRequest 8*1b3f573fSAndroid Build Coastguard Worker [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 9*1b3f573fSAndroid Build Coastguard Worker 10*1b3f573fSAndroid Build Coastguard Worker $InstallScriptUrl = 'https://dot.net/v1/dotnet-install.ps1' 11*1b3f573fSAndroid Build Coastguard Worker $InstallScriptPath = Join-Path "$env:TEMP" 'dotnet-install.ps1' 12*1b3f573fSAndroid Build Coastguard Worker 13*1b3f573fSAndroid Build Coastguard Worker # Download install script 14*1b3f573fSAndroid Build Coastguard Worker Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath" 15*1b3f573fSAndroid Build Coastguard Worker Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath 16*1b3f573fSAndroid Build Coastguard Worker 17*1b3f573fSAndroid Build Coastguard Worker # The SDK versions to install should be kept in sync with versions 18*1b3f573fSAndroid Build Coastguard Worker # installed by kokoro/linux/dockerfile/test/csharp/Dockerfile 19*1b3f573fSAndroid Build Coastguard Worker &$InstallScriptPath -Version 3.1.415 20*1b3f573fSAndroid Build Coastguard Worker &$InstallScriptPath -Version 6.0.100 21