PowerTip: Compare Two Objects with PowerShell

The Scripting Guys


Summary: Learn how to use Windows PowerShell to compare two objects to see differences.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see if a particular property from two objects is the same?

Hey, Scripting Guy! Answer Use the Compare-Object cmdlet, specify the reference object, the object to compare, and
           the property you are interested in looking at, for example:

Compare-Object -ReferenceObject $d -DifferenceObject $p -Property lockout

The Scripting Guys
Dr Scripto

Follow Dr   

No Comments.