With the release of PowerShell 7.4 a breaking change was introduced, "Test-Json now uses JsonSchema.Net instead of Newtonsoft.Json.Schema. With this change, Test-Json no longer supports the older Draft 4 schemas.".
As 'installerSettings.schema.json' is generated with a Draft v4 this change causes 'New-EPRInstallation' to fail.
System.Exception: Cannot parse the JSON schema. ---> Microsoft.PowerShell.Commands.JsonSchemaReferenceResolutionException: Exception of type 'Microsoft.PowerShell.Commands.JsonSchemaReferenceResolutionException' was thrown. ---> System.Text.Json.JsonException: Expected number at Json.Schema.ExclusiveMinimumKeywordJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at Json.Schema.JsonSerializerOptionsExtensions.ArbitraryDeserializer1.Read(Utf8JsonReader& reader,
JsonSerializerOptions options) at Json.Schema.SchemaJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert,
JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonDictionaryConverter3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert,
JsonSerializerOptions options, ReadStack& state, TDictionary& value) at
System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonResumableConverter1.Read(Utf8JsonReader& reader, Type typeToConvert,
JsonSerializerOptions options) at Json.Schema.PropertiesKeywordJsonConverter.Read(Utf8JsonReader& reader, Type
typeToConvert, JsonSerializerOptions options) at
Json.Schema.JsonSerializerOptionsExtensions.ArbitraryDeserializer1.Read(Utf8JsonReader& reader, JsonSerializerOptions options) at Json.Schema.SchemaJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert,
JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at
System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json,
JsonSerializerOptions options) at Microsoft.PowerShell.Commands.TestJsonCommand.<>c.b__30_0(Uri
uri) --- End of inner exception stack trace --- at
Microsoft.PowerShell.Commands.TestJsonCommand.<>c.b__30_0(Uri uri) at
Json.Schema.SchemaRegistry.GetRegistration(Uri uri) at Json.Schema.JsonSchema.DetermineSpecVersion(JsonSchema
schema, SchemaRegistry registry, SpecVersion desiredDraft) at Json.Schema.JsonSchema.Evaluate(JsonNode root,
EvaluationOptions options) at Microsoft.PowerShell.Commands.TestJsonCommand.ProcessRecord() --- End of inner
exception stack trace ---`
We need to generate a new schema with Draft v7 and update the installation package.
With the release of PowerShell 7.4 a breaking change was introduced, "Test-Json now uses JsonSchema.Net instead of Newtonsoft.Json.Schema. With this change, Test-Json no longer supports the older Draft 4 schemas.".
https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-74?view=powershell-7.4#breaking-changes
https://github.com/PowerShell/PowerShell/pull/18141
As 'installerSettings.schema.json' is generated with a Draft v4 this change causes 'New-EPRInstallation' to fail.
System.Exception: Cannot parse the JSON schema. ---> Microsoft.PowerShell.Commands.JsonSchemaReferenceResolutionException: Exception of type 'Microsoft.PowerShell.Commands.JsonSchemaReferenceResolutionException' was thrown. ---> System.Text.Json.JsonException: Expected number at Json.Schema.ExclusiveMinimumKeywordJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at Json.Schema.JsonSerializerOptionsExtensions.ArbitraryDeserializer
1.Read(Utf8JsonReader& reader, JsonSerializerOptions options) at Json.Schema.SchemaJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonDictionaryConverter
3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TDictionary& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonResumableConverter
1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at Json.Schema.PropertiesKeywordJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at Json.Schema.JsonSerializerOptionsExtensions.ArbitraryDeserializer1.Read(Utf8JsonReader& reader, JsonSerializerOptions options) at Json.Schema.SchemaJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable
1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo
1 jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at Microsoft.PowerShell.Commands.TestJsonCommand.<>c.We need to generate a new schema with Draft v7 and update the installation package.