diff --git a/Engine/PSScriptAnalyzer.psm1 b/Engine/PSScriptAnalyzer.psm1 index 8c55c1d7e..da62d9ef9 100644 --- a/Engine/PSScriptAnalyzer.psm1 +++ b/Engine/PSScriptAnalyzer.psm1 @@ -13,8 +13,12 @@ $binaryModuleRoot = $PSModuleRoot if (($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition -ne 'Desktop')) { $binaryModuleRoot = Join-Path -Path $PSModuleRoot -ChildPath 'coreclr' - if ($PSVersionTable.PSVersion -lt [Version]'6.1.0') { - throw "Minimum supported version of PSScriptAnalyzer for PowerShell Core is 6.1.0 but current version is '$($PSVersionTable.PSVersion)'. Please update PowerShell Core." + # Minimum PowerShell Core version given by PowerShell Core support itself and + # also the version of NewtonSoft.Json implicitly that PSSA ships with, + # which cannot be higher than the one that PowerShell ships with. + [Version] $minimumPowerShellCoreVersion = '6.2.0' + if ($PSVersionTable.PSVersion -lt $minimumPowerShellCoreVersion) { + throw "Minimum supported version of PSScriptAnalyzer for PowerShell Core is $minimumPowerShellCoreVersion but current version is '$($PSVersionTable.PSVersion)'. Please update PowerShell Core." } } elseif ($PSVersionTable.PSVersion.Major -eq 5) { diff --git a/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj b/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj index e20f86c08..41f50f145 100644 --- a/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj +++ b/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net452 @@ -20,7 +20,7 @@ - + diff --git a/Rules/Rules.csproj b/Rules/Rules.csproj index ff8649a28..bb213aa53 100644 --- a/Rules/Rules.csproj +++ b/Rules/Rules.csproj @@ -10,7 +10,7 @@ - + diff --git a/appveyor.yml b/appveyor.yml index d3f02b1be..643caf59b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ environment: BuildConfiguration: Release DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # For faster CI builds matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 PowerShellEdition: PowerShellCore - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 PowerShellEdition: WindowsPowerShell