Skip to content

Instantly share code, notes, and snippets.

@Master-Guy
Master-Guy / MergeJson.ps1
Created November 6, 2021 13:32
Merge two JSON files
# Function to merge two JSON files, where the 2nd will override any settings in the 1st with the same name.
# Original by https://github.com/Master-Guy (Discord: Master-Guy#0001)
function JsonMerge {
param(
[Parameter(Mandatory)]
[PSCustomObject] $Json1,
[Parameter(Mandatory)]
[PSCustomObject] $Json2,
[parameter(DontShow)]
[int] $Nesting = 0,