Create a new JSON string by recursively combining the properties of JSON strings.
Merge-Json.ps1 [-InputObject] <String[]> [-Compress] [-ProgressAction <ActionPreference>] [<CommonParameters>]
'{"a":1,"b":{"u":3},"c":{"v":5}}','{"a":{"w":8},"b":2,"c":{"x":6}}' |Merge-Json.ps1
{ “a”: { “w”: 8 }, “b”: 2, “c”: { “v”: 5, “x”: 6 } }
JSON string to combine. Descendant properties are recursively merged. Primitive values are overwritten by any matching ones in the new JSON string.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Omits white space and indented formatting in the output string.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.