Hello!
I want to run our Windows Service using HTTPS. I edited the appsettings.json file located in ProgramData.
After making the changes, the Windows Service starts but crashes immediately.
Here’s what my JSON looks like:
{
"Kestrel": {
"Endpoints": {
"HTTPS": {
"Url": "https://*:443",
"Certificate": {
"Subject": "servername.censored",
"Store": "My",
"Location": "LocalMachine",
"AllowInvalid": "true"
}
}
}
},
"Plugins": [
"SQLite"
],
"Data": {
"RepositoryPath": "%ProgramData%\\UniversalAutomation\\Repository",
"ConnectionString": "Data Source=%ProgramData%\\UniversalAutomation\\database.db"
},
"Mode": "Server",
"PSUTelemetry": false
}
https://jsonlint.com/ tells me hat the JSON is valid.
systemLog:
2025-07-07 09:14:26.247 +02:00 [ERR] Error configuring web server.
System.IO.InvalidDataException: Failed to load configuration from file 'C:\ProgramData\PowerShellUniversal\appsettings.json'.
---> System.FormatException: Could not parse the JSON file.
---> System.Text.Json.JsonReaderException: Expected depth to be zero at the end of the JSON payload. There is an open JSON object or array that should be closed. LineNumber: 22 | BytePositionInLine: 1.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
Thanks in Advance!
Product: PowerShell Universal
Version: 5.5.4 (15428518832)