Powershell: Compare-object not comparing nested objects Powershell: Compare-object not comparing nested objects json json

Powershell: Compare-object not comparing nested objects


Don't know if it's any better or not, but:

$jsonString1 = '{ "baz": "quuz", "cow": [ "moo", "CUD" ], "foo": "bar" }'$jsonstring2 = '{ "baz": "quuz", "cow": [ "moo", "GRASS" ], "foo": "bar" }'compare $jsonString1.split(',:[]{}') $jsonString2.split(',:[]{}')InputObject                                          SideIndicator                                      -----------                                          -------------                                       "GRASS"                                             =>                                                  "CUD"                                               <=