Let's say you have two objects that are identical (meaning they have the same properties and the same values respectively).
How do you test for equality?
Example
$obj1
& $obj2
are identical
Here's what I've tried:
if($obj1 -eq $obj2)
{
echo 'true'
} else {
echo 'false'
}
# RETURNS "false"
if(Compare-Object -ReferenceObject $obj1 -DifferenceObject $obj2)
{
echo 'true'
} else {
echo 'false'
}
# RETURNS "false"
Aucun commentaire:
Enregistrer un commentaire