Skip to content

Instantly share code, notes, and snippets.

@edxi
edxi / Compare-Hashtable.ps1
Last active November 30, 2021 09:20
Compare-Hashtable
function Compare-Hashtable {
<#
.SYNOPSIS
Compare two Hashtable and returns an array of differences.
.DESCRIPTION
The Compare-Hashtable function computes differences between two Hashtables. Results are returned as
an array of objects with the properties: "key" (the name of the key that caused a difference),
"side" (one of "<=", "!=" or "=>"), "lvalue" an "rvalue" (resp. the left and right value
associated with the key).