From the course: PowerShell: Functions for Advanced Automation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use JSON-formatted data

Use JSON-formatted data

From the course: PowerShell: Functions for Advanced Automation

Start my 1-month free trial

Use JSON-formatted data

- [Instructor] JavaScript Object Notation is a data format that has a lot of similarities to XML. It's often abbreviated JSON and it uses a streamlined syntax to store strings, values, lists, objects, and more in a hierarchical structure. That sounds a lot like XML, doesn't it? There's an ongoing debate as to which one is better. Some people introduced JSON as the next XML. Others dismissed JSON as a newcomer that won't last. My take is that they each have their place. The best way for me to show you what JSON is is to do a direct comparison to XML. Let me go ahead and use the Get-Service commandlet and port it through Export-clixml to create an XML file and then use the same Get-Service list on the same workstation, ConvertTo-Json and then port that out to a file. If I go ahead and run both of these commandlets, two files will be created. Here they are, Services.json and Services.xml. Right off the bat, we can see one difference. The XML file is approximately eight times the size of…

Contents