July 2nd, 2015

PowerTip: Compare Two Objects with PowerShell

Doctor Scripto
Scripter

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

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.