From daf1499442d3b652590a36ea64fe0c433d95d10c Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Wed, 11 Sep 2019 19:20:19 +0100 Subject: [PATCH 1/3] Upgrade NewtonSoft.Json to the version that PS 6.2.1 ships with as PS 6.1 is going out of support now --- Engine/PSScriptAnalyzer.psm1 | 8 ++++++-- .../Microsoft.PowerShell.CrossCompatibility.csproj | 4 ++-- Rules/Rules.csproj | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Engine/PSScriptAnalyzer.psm1 b/Engine/PSScriptAnalyzer.psm1 index 8c55c1d7e..899f98551 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.1' + 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..c1a5a2ee4 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..05ef0aa75 100644 --- a/Rules/Rules.csproj +++ b/Rules/Rules.csproj @@ -10,7 +10,7 @@ - + From 808b7b896f91433d0df118bfd94492b8622958f0 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Wed, 11 Sep 2019 22:59:09 +0100 Subject: [PATCH 2/3] Upgrade AppVeyor image to use PS 6.2 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a3f236326e386cd75578e920833993ff5023f559 Mon Sep 17 00:00:00 2001 From: Christoph Bergmeister Date: Thu, 12 Sep 2019 08:48:41 +0100 Subject: [PATCH 3/3] Downgrade to PS 6.2.0 as a minimum PS version due to AppVeyor --- Engine/PSScriptAnalyzer.psm1 | 2 +- .../Microsoft.PowerShell.CrossCompatibility.csproj | 2 +- Rules/Rules.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Engine/PSScriptAnalyzer.psm1 b/Engine/PSScriptAnalyzer.psm1 index 899f98551..da62d9ef9 100644 --- a/Engine/PSScriptAnalyzer.psm1 +++ b/Engine/PSScriptAnalyzer.psm1 @@ -16,7 +16,7 @@ if (($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition # 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.1' + [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." } diff --git a/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj b/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj index c1a5a2ee4..41f50f145 100644 --- a/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj +++ b/PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj @@ -20,7 +20,7 @@ - + diff --git a/Rules/Rules.csproj b/Rules/Rules.csproj index 05ef0aa75..bb213aa53 100644 --- a/Rules/Rules.csproj +++ b/Rules/Rules.csproj @@ -10,7 +10,7 @@ - +