The following JSON is getting returned from OData API service:
{"d": {"results": [ {"FileSystemObjectType": 0,"Id": 1,"ContentTypeId": "0x0100BC97B2F575CB0C42B79549F3BABD32A8","Title": "Nokia California","Address": "200 South Matilda Avenue\nW Washington Ave\n94086 Sunnyvale, California\nUnited States of America","ID": 1,"Modified": "2014-02-24T10:06:39Z","Created": "2014-02-24T10:06:39Z","AuthorId": 12,"EditorId": 12,"OData__UIVersionString": "1.0","Attachments": false,"GUID": "d12aafad-502a-4968-a69e-36a7ea05ec80" } ] }}and saved as a string into variable named $data
An attempt to convert a JSON-formatted string to a custom object using ConvertFrom-Json cmdlet:
$results = $data | ConvertFrom-Jsongives the following error:
ConvertFrom-Json : Cannot convert the JSON string because a dictionary that was converted from the string contains the duplicated keys 'Id' and 'ID'.
Is there any way to convert the specified JSON-formatted string in PowerShell?