Prefer version when available for dotnet-install (#15810)

This commit is contained in:
Aditya Patwardhan 2021-07-20 23:34:39 -07:00 committed by GitHub
parent ac762c1cce
commit 408c4fd9ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1781,10 +1781,15 @@ function Install-Dotnet {
Invoke-WebRequest -Uri $installObtainUrl/$installScript -OutFile $installScript
if (-not $environment.IsCoreCLR) {
$installArgs = @{
Channel = $Channel
Quality = $Quality
}
if ($Version) {
$installArgs += @{ Version = $Version }
} elseif ($Channel) {
$installArgs += @{ Channel = $Channel }
}
if ($InstallDir) {
$installArgs += @{ InstallDir = $InstallDir }
}