diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 46fc0736a..e4c2e0f4b 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -33,14 +33,7 @@ function Invoke-AppVeyorInstall { # the legacy WMF4 image only has the old preview SDKs of dotnet $globalDotJson = Get-Content (Join-Path $PSScriptRoot '..\global.json') -Raw | ConvertFrom-Json $requiredDotNetCoreSDKVersion = $globalDotJson.sdk.version - if ($PSVersionTable.PSVersion.Major -gt 4) { - $requiredDotNetCoreSDKVersionPresent = (dotnet --list-sdks) -match $requiredDotNetCoreSDKVersion - } - else { - # WMF 4 image has old SDK that does not have --list-sdks parameter - $requiredDotNetCoreSDKVersionPresent = (dotnet --version).StartsWith($requiredDotNetCoreSDKVersion) - } - if (-not $requiredDotNetCoreSDKVersionPresent) { + if (-not ((dotnet --version).StartsWith($requiredDotNetCoreSDKVersion))) { Write-Verbose -Verbose "Installing required .Net CORE SDK $requiredDotNetCoreSDKVersion" $originalSecurityProtocol = [Net.ServicePointManager]::SecurityProtocol try {