Is there a way for the Compare-Object cmdlet to anticipate on $Null values?
For example when I'm trying to compare 2 values like this:
Compare-Object -ReferenceObject $Value1 -DifferenceObject $Value2
I commonly get the following error:
Cannot bind argument to parameter 'ReferenceObject' because it is null
My question is: Is there a way to say: if either one of them equals $null ; do something