Creating New Objects the JSON way

by Nov 21, 2012

There are numerous ways how you can create new objects that you may use to return results from your functions. One way is using JSON, a very simple description language. It is fully supported in PowerShell 3.0. Have a look:

PS> $content = '{"Name":"weltner","FirstName":"tobias","id":123}'
PS> ConvertFrom-Json $content

Name                          FirstName                                                id
----                          -------                                                  --
weltner                       tobias                                                  123

Twitter This Tip! ReTweet this Tip!