Powershell Tip #49: Compare two sets of objects

By | October 6, 2015

Tip: You want to compare two sets of objects.

For example, you want to take a “snapshot” from your running processes and check after a while the difference (based on another “snapshot”).

You could use the same logicial to compare processes on two different computers for example.

ReferenceObject : the “source”, the reference object you will use to compare

DifferenceObject : the object you will compare to the reference object.

Compare-Object -ReferenceObject $before -DifferenceObject $after


Compare-Object -ReferenceObject $before -DifferenceObject $after -IncludeEqual



Leave a Reply

Your email address will not be published.