Skip to content

Commit

Permalink
simplify dotnet check
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmeister committed Jan 3, 2019
1 parent 91765b0 commit 7db40c3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7db40c3

Please sign in to comment.