install_dotnet_sdk.ps1 794 B

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