Skip to content

Commit b9fd7b3

Browse files
bergmeisterJamesWTruher
authored andcommitted
Update Newtonsoft json to 12.0.1 due to PowerShell 6.1 going out of support (#1336)
* Upgrade NewtonSoft.Json to the version that PS 6.2.1 ships with as PS 6.1 is going out of support now * Upgrade AppVeyor image to use PS 6.2 * Downgrade to PS 6.2.0 as a minimum PS version due to AppVeyor
1 parent 94e8573 commit b9fd7b3

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Engine/PSScriptAnalyzer.psm1

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ $binaryModuleRoot = $PSModuleRoot
1313

1414
if (($PSVersionTable.Keys -contains "PSEdition") -and ($PSVersionTable.PSEdition -ne 'Desktop')) {
1515
$binaryModuleRoot = Join-Path -Path $PSModuleRoot -ChildPath 'coreclr'
16-
if ($PSVersionTable.PSVersion -lt [Version]'6.1.0') {
17-
throw "Minimum supported version of PSScriptAnalyzer for PowerShell Core is 6.1.0 but current version is '$($PSVersionTable.PSVersion)'. Please update PowerShell Core."
16+
# Minimum PowerShell Core version given by PowerShell Core support itself and
17+
# also the version of NewtonSoft.Json implicitly that PSSA ships with,
18+
# which cannot be higher than the one that PowerShell ships with.
19+
[Version] $minimumPowerShellCoreVersion = '6.2.0'
20+
if ($PSVersionTable.PSVersion -lt $minimumPowerShellCoreVersion) {
21+
throw "Minimum supported version of PSScriptAnalyzer for PowerShell Core is $minimumPowerShellCoreVersion but current version is '$($PSVersionTable.PSVersion)'. Please update PowerShell Core."
1822
}
1923
}
2024
elseif ($PSVersionTable.PSVersion.Major -eq 5) {

PSCompatibilityCollector/Microsoft.PowerShell.CrossCompatibility/Microsoft.PowerShell.CrossCompatibility.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
@@ -20,7 +20,7 @@
2020
<ItemGroup>
2121
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
2222
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0" />
23-
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
23+
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
2424
</ItemGroup>
2525

2626
</Project>

Rules/Rules.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<ItemGroup>
1212
<ProjectReference Include="..\Engine\Engine.csproj" />
13-
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
13+
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
1414
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0" />
1515
</ItemGroup>
1616

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ environment:
33
BuildConfiguration: Release
44
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # For faster CI builds
55
matrix:
6-
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
6+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
77
PowerShellEdition: PowerShellCore
88
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
99
PowerShellEdition: WindowsPowerShell

0 commit comments

Comments
 (0)