Skip to content

Commit

Permalink
Revert changes (#873)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Watherston <[email protected]>
  • Loading branch information
anwather and Anthony Watherston authored Feb 3, 2025
1 parent 7d5e0e8 commit f156aa9
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions Scripts/Helpers/Confirm-ObjectValueEqualityDeep.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,9 @@ function Confirm-ObjectValueEqualityDeep {
# $Object1 or $Object2 is an array or ArrayList
if ($Object1 -isnot [System.Collections.Ilist]) {
$Object1 = @($Object1)
# This resolves a unique situation where GraphApi returns a string instead of an array for a metadata value, very unique situation
# By testing the json and count, we can confirm that it is a json string and convert it to an array
# A try catch is included to revert to the value we normally use in the event of failure just in case there is a scenario that has not been accounted for
if ($(Test-Json -Json $Object1) -and $Object1.count -eq 1) {
try {
$Object1 = $Object1 | ConvertFrom-Json -Depth 100
}
catch {
$Object1 = @($Object1)
}
}
}
elseif ($Object2 -isnot [System.Collections.Ilist]) {
$Object2 = @($Object2)
# This resolves a unique situation where GraphApi returns a string instead of an array for a metadata value, very unique situation
# By testing the json and count, we can confirm that it is a json string and convert it to an array
# A try catch is included to revert to the value we normally use in the event of failure just in case there is a scenario that has not been accounted for
if ($(Test-Json -Json $Object2) -and $Object2.count -eq 1) {
try {
$Object2 = $Object2 | ConvertFrom-Json -Depth 100
}
catch {
$Object2 = @($Object2)
}
}
}
if ($Object1.Count -ne $Object2.Count) {
return $false
Expand Down

0 comments on commit f156aa9

Please sign in to comment.