You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one query the System Info via API it will return "fanSpeed" and "fanspeed".
Powershell can't parse the JSON, because it handels the returned JSON key as case-insensitive. Powershell will treat "fanSpeed" and "fanspeed" as a dupicate Key in the returned JSON Data.
$targetip="192.168.0.239"# Get JSON Data from API$WebResponse=Invoke-WebRequest-Uri "http://$($targetip)/api/system/info"# Convert JSON to PowerShell object$WebObject=ConvertFrom-Json$WebResponse.content
Powershell Error Message
ConvertFrom-Json : Die JSON-Zeichenfolge kann nicht konvertiert werden, weil ein aus der Zeichenfolge
konvertiertes Wörterbuch die doppelten Schlüssel "fanSpeed" und "fanspeed" enthält.
In Zeile:14 Zeichen:14
+ $WebObject = ConvertFrom-Json $WebResponse.content
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [ConvertFrom-Json], InvalidOperationException
+ FullyQualifiedErrorId : DuplicateKeysInJsonString,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
Error: DuplicateKeysInJsonString "fanSpeed" and "fanspeed" in JSON Data the API returns.
Suggested Fix
Maybe change fanSpeed to fanSpeedRpm for example
The text was updated successfully, but these errors were encountered:
If one query the System Info via API it will return "fanSpeed" and "fanspeed".
Powershell can't parse the JSON, because it handels the returned JSON key as case-insensitive. Powershell will treat "fanSpeed" and "fanspeed" as a dupicate Key in the returned JSON Data.
Example JSON Data from API
Example Powershell API Query
Powershell Error Message
Error: DuplicateKeysInJsonString "fanSpeed" and "fanspeed" in JSON Data the API returns.
Suggested Fix
fanSpeed
tofanSpeedRpm
for exampleThe text was updated successfully, but these errors were encountered: