"Fossies" - the Fresh Open Source Software Archive

Member "protobuf-3.12.3/csharp/install_dotnet_sdk.ps1" (2 Jun 2020, 972 Bytes) of package /linux/misc/protobuf-all-3.12.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Microsoft PowerShell source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "install_dotnet_sdk.ps1": 3.11.4_vs_3.12.0.

    1 #!/usr/bin/env powershell
    2 # Install dotnet SDK based on the SDK version from global.json
    3 
    4 Set-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 $GlobalJsonPath = Join-Path $PSScriptRoot '..' | Join-Path -ChildPath 'global.json'
   13 
   14 # Resolve SDK version from global.json file
   15 $GlobalJson = Get-Content -Raw $GlobalJsonPath | ConvertFrom-Json
   16 $SDKVersion = $GlobalJson.sdk.version
   17 
   18 # Download install script
   19 Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath"
   20 Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath
   21 &$InstallScriptPath -Version $SDKVersion
   22 
   23 # Also install dotnet SDK LTS which is required to run some of the tests
   24 &$InstallScriptPath -Version 2.1.802