PowerTip: Compare Two Objects with PowerShell


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

Comments (0)

Skip to main content