In last post, we have described on what JSON is and how it is becoming increasingly important in the DevOps phenomenon. So its necessarily not only to understand the format, but also involve in our tools of choices. Microsoft has introduced couple of cmdlets in PowerShell to make use of JSON format namely ConvertFrom-JSON and ConvertTo-JSON.
Again, we can get the same by making use of Get-Command cmdlet:

As an example, we are going to start with below sample data object:
{ "ts":1409318650332, "userId":"309", "sessionId":1879, "page":"NextSong", "auth":"Logged In", "method":"PUT", "status":200, "level":"free", "itemInSession":2, "location":"Killeen-Temple, TX", "lastName":"Montgomery", "firstName":"Annalyse", "registration":1384448062332, "gender":"F", "artist":"El Arrebato", "song":"Quiero Quererte Querer", "length":234.57914 }
So, first we need to store this inside a variable:
$data = '{"ts":1409318650332,"userId":"309","sessionId":1879,"page":"NextSong","auth": "Logged In","method":"PUT","status":200,"level":"free","itemInSession":2,"location":"Killeen-Temple, TX","lastName":"Mon tgomery","firstName":"Annalyse","registration":1384448062332,"gender":"F","artist":"El Arrebato","song":"Quiero Quererte Querer","length":234.57914}'
Note that we have to use single quotation around data so that it does not confuse our PowerShell. Now, we need to import this data inside a another variable, using ConvertFrom-JSON cmdlet:
$psdata = ConvertFrom-JSON -InputObject $data
Once its done, we can see the datatype of variable using gettype() method:

We can also see the properties using Get-Member cmdlet and verify that data is imported correctly:
$psdata | gm
After this, we can simple leverage dot notation to access objects:
Let’s assume some real world data using PowerShell. For this, we will make use of MusicBrainz web services API. (More details at: https://wiki.musicbrainz.org/Development/JSON_Web_Service)
The following request performs an artist lookup and returns a description, name, and country of origin (in addition to other stuff) about the artist. The query contains the website, the API, the artist information, and the format requested. Here is the query string:
$request = 'http://musicbrainz.org/ws/2/artist/5b11f4ce-a62d-471e-81fc-a69a8278c7da?inc=aliases&fmt=json'
To execute this query is simple, we use Invoke-WebRequest. This appears here:
Invoke-WebRequest $request

If we just see the output as of now, it would look like:

We now need to convert from JSON format. For this, we can use:
$sitedata = ConvertFrom-JSON $data

We can now use simple formatting in PowerShell to read this data further.