Skip to content

Instantly share code, notes, and snippets.

@IISResetMe
Created July 15, 2019 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IISResetMe/705a8a7bdd4b8940d0061bcc71070ff4 to your computer and use it in GitHub Desktop.
Save IISResetMe/705a8a7bdd4b8940d0061bcc71070ff4 to your computer and use it in GitHub Desktop.
function Compare-Array
{
param(
[array]$Ref,
[array]$Diff
)
$max = [math]::Max($Ref.Length,$Diff.Length)
for($i = 0; $i -lt $max; $i++){
if($Ref[$i] -ne $Diff[$i]){
[pscustomobject]@{
Index = $i
Left = $Ref[$i]
Right = $Diff[$i]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment