Skip to content

Instantly share code, notes, and snippets.

@octan3
Created August 4, 2011 11:46
Show Gist options
  • Save octan3/1125017 to your computer and use it in GitHub Desktop.
Save octan3/1125017 to your computer and use it in GitHub Desktop.
PowerShell JSON Parser (compact)
$code = "static function parseJSON(json) {return eval('(' +json + ')');}"
$JSONUtil = (Add-Type -Language JScript -MemberDefinition $code -Name "JSONUtil" -PassThru)[1]
$obj = $JSONUtil::parseJSON($jsonString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment