$obj = [psObject] @{ txt = 'Hello world' num = 42 bla = 'foo', 'bar', 'baz' } convertTo-json $obj # # { # "bla": [ # "foo", # "bar", # "baz" # ], # "txt": "Hello world", # "num": 42 # }
convertFrom-json
parses a string that contains a JSON value to a PowerShell object.