Default channel=LTS
Clarify nomenclature from "alternate" to "legacy" Skip construction of legacy URL if it's flawed.
This commit is contained in:
parent
07b93e9d7c
commit
cd753db228
2 changed files with 31 additions and 23 deletions
14
scripts/obtain/dotnet-install.ps1
vendored
14
scripts/obtain/dotnet-install.ps1
vendored
|
@ -10,7 +10,7 @@
|
|||
Installs dotnet cli. If dotnet installation already exists in the given directory
|
||||
it will update it only if the requested version differs from the one already installed.
|
||||
.PARAMETER Channel
|
||||
Default: release/1.0.0
|
||||
Default: LTS
|
||||
Download from the Channel specified
|
||||
.PARAMETER Version
|
||||
Default: latest
|
||||
|
@ -55,7 +55,7 @@
|
|||
#>
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[string]$Channel="release/1.0.0",
|
||||
[string]$Channel="LTS",
|
||||
[string]$Version="Latest",
|
||||
[string]$InstallDir="<auto>",
|
||||
[string]$Architecture="<auto>",
|
||||
|
@ -261,7 +261,7 @@ function Get-Download-Link([string]$AzureFeed, [string]$Channel, [string]$Specif
|
|||
return $PayloadURL
|
||||
}
|
||||
|
||||
function Get-AltDownload-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||
function Get-LegacytDownload-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
if ($SharedRuntime) {
|
||||
|
@ -271,7 +271,7 @@ function Get-AltDownload-Link([string]$AzureFeed, [string]$Channel, [string]$Spe
|
|||
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip"
|
||||
}
|
||||
|
||||
Say-Verbose "Constructed alternate payload URL: $PayloadURL"
|
||||
Say-Verbose "Constructed legacy payload URL: $PayloadURL"
|
||||
|
||||
return $PayloadURL
|
||||
}
|
||||
|
@ -432,12 +432,12 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
|
|||
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
|
||||
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
|
||||
$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
$AltDownloadLink = Get-AltDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
|
||||
if ($DryRun) {
|
||||
Say "Payload URLs:"
|
||||
Say "Primary - $DownloadLink"
|
||||
Say "Alternate - $AltDownloadLink"
|
||||
Say "Legacy - $LegacyDownloadLink"
|
||||
Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir"
|
||||
exit 0
|
||||
}
|
||||
|
@ -469,7 +469,7 @@ try {
|
|||
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
||||
}
|
||||
catch {
|
||||
$DownloadLink = $AltDownloadLink
|
||||
$DownloadLink = $LegacyDownloadLink
|
||||
$ZipPath = [System.IO.Path]::GetTempFileName()
|
||||
Say "Downloading $DownloadLink"
|
||||
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue