Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit d3373d9

Browse files
author
John Beisner
committed
Removing unused parameters.; ".StartsWith" method for strings is not always present.
1 parent 229518b commit d3373d9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/obtain/dotnet-install.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function GetHTTPResponse([Uri] $Uri)
173173
}
174174

175175

176-
function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [string]$CLIArchitecture) {
176+
function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) {
177177
Say-Invocation $MyInvocation
178178

179179
$VersionFileUrl = $null
@@ -189,7 +189,8 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [string]$
189189

190190
switch ($Response.Content.Headers.ContentType) {
191191
{ ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($StringContent) }
192-
{ ($_.StartsWith("text/plain")) } { $VersionText = $StringContent }
192+
{ ($_ -eq "text/plain") } { $VersionText = $StringContent }
193+
{ ($_ -eq "text/plain; charset=UTF-8") } { $VersionText = $StringContent }
193194
default { throw "``$Response.Content.Headers.ContentType`` is an unknown .version file content type." }
194195
}
195196

@@ -199,12 +200,12 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [string]$
199200
}
200201

201202

202-
function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$CLIArchitecture, [string]$Version) {
203+
function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version) {
203204
Say-Invocation $MyInvocation
204205

205206
switch ($Version.ToLower()) {
206207
{ $_ -eq "latest" } {
207-
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -CLIArchitecture $CLIArchitecture
208+
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel
208209
return $LatestVersionInfo.Version
209210
}
210211
default { return $Version }
@@ -383,7 +384,7 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
383384
}
384385

385386
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
386-
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -CLIArchitecture $CLIArchitecture -Version $Version
387+
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
387388
$DownloadLinks = Get-Download-Links -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
388389

389390
if ($DryRun) {

0 commit comments

Comments
 (0)