title: How do I use Json.NET to parse json in PowerShell?
body: <p>I want to parse JSON in PowerShell but I can't use the new v3 functions that are available in PowerShell. My first thought was to load the JSON.Net assembly and use that to parse the JSON string but it doesn't work as I expect it to.</p>
  
  <p>I have this JSON:</p>
  
  <pre><code>$json = "{""Name"": ""Apple"",  
             ""Price"": 3.99,  
              ""Sizes"": [    
                   ""Small"",    
                   ""Medium"",
                   ""Large""]}"
  </code></pre>
  
  <p>I load the JSON.NET assembly with this code: </p>
  
  <pre><code>[Reflection.Assembly]::LoadFile("$currentPath\Newtonsoft.Json.dll”)
  </code></pre>
  
  <p>And tries to parse it with</p>
  
  <pre><code>$result = [Newtonsoft.Json.JsonConvert]::DeserializeObject($json)
  </code></pre>
  
  <p>Now I expect that <code>$result["Name"]</code> is <code>Apple</code> but I get nothing there. Any ideas?</p>
  
  <p>The code ´$result.ContainsKey("Name")<code>returns</code>True<code>but</code>$result.GetValue("Name")<code>returns</code>null`.</p>