Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 346 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read JSON object in Powershell 2.0

#1
I am using Powershell 2.0 (cannot make an upgarde to V3.0 as of now) and I want to read the JSON object from bellow:

```json
{"DevResults":[{"TechnologyName":"AD","RuleName":"SOA account (user logon/display name)","OutputValue":"SOADevClientCenter"},
{"TechnologyName":"AD","RuleName":"SOA account (pre-Windows 2000)","OutputValue":"SOADevCliCen"},
"ProdResults":[{"TechnologyName":"AD","RuleName":"SOA account (user logon/display name)","OutputValue":"SOAClientCenter"},
{"TechnologyName":"AD","RuleName":"BPM Service Account (pre-Windows 2000)","OutputValue":"BPM_CliCen_05"}]}
```
Reply

#2
You probably have the System.Web.Extensions available, and as such you can load that assembly and use the <a href="http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx">JSON parser</a> 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:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through