Read Json Object in Powershell 2.0 Read Json Object in Powershell 2.0 json json

Read Json Object in Powershell 2.0


You probably have the System.Web.Extensions available, and as such you can load that assembly and use the JSON parser that is available. Here is a quick sample:

[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")$json = "{a:1,b:2,c:{nested:true}}"$ser = New-Object System.Web.Script.Serialization.JavaScriptSerializer$obj = $ser.DeserializeObject($json)

Reference: http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx