Here is a simple json parser: https://gist.github.com/octan3/1125017
$code = "static function parseJSON(json) {return eval('(' +json + ')');}" $JSONUtil = (Add-Type -Language JScript -MemberDefinition $code -Name "JSONUtil" -PassThru)[1] $obj = $JSONUtil::parseJSON($jsonString)
-PassThru will provide you with an object (in fact two objects, you want a second) that you can use to call functions.
You can omit it if you want and call the function as follows:
[Microsoft.PowerShell.Commands.AddType.AutoGeneratedTypes.JSONUtil]::parseJSON($jsonString)
but it's a little pain.
John fouhy
source share