Please feel free to provide feedback or file bugs here.

Duplicate keys error with ConvertFrom-Json

Votes from Connect: 5

Original Date Submitted: 9/3/2014 2:35:32 AM

Description:
********Contact Information********
Handle: bvbutts
Site Name: PowerShell
Feedback ID: 962299
***************************************

Frequency: Always Happens
Regression: I do not know if this issue existed previously

Problem Description:
If you try to parse JSON with parameters that differ by case, eg. {"test":"some value","Test":"some other value"}, you get a duplicate keys error. However, case sensitivity among parameters seems to be a supported feature of JSON. Furthermore, jsonlint.com views this as valid JSON.

Product Studio item created by Connect Synchronizer due to creation of feedback ID 962299 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=962299).

Repro Steps:
$x='{"test":"some value","Test":"some other value"}'|ConvertFrom-Json

Expected Results:
I expected this JSON to parse into a regular PSCustomObject/collection. As a work-around, you can deserialize such JSON strings with the .NET object System.Web.Script.Serialization.JavaScriptSerializer, but I'd prefer to use the PowerShell cmdlets. I've only experienced this issue in PowerShell 3.0; I haven't tested it in more recent versions.

Internal BugId: 8984

9 votes
Sign in
(thinking…)
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

AdminJoey Aiello [MSFT] (Program Manager, Windows Server) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base