Contact Info

Crumbtrail » Administration » Powershell » Powershell 2.0 » Compare-Object

Compare-Object - Powershell 2.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.


Short description
Compares two sets of objects.

Compare-Object [-ReferenceObject] <PSObject[]> [-DifferenceObject] <PSObject[]> [-CaseSensitive] [-Culture <string>
    ] [-ExcludeDifferent] [-IncludeEqual] [-PassThru] [-Property <Object[]>] [-SyncWindow <int>] [<CommonParameters>]

The Compare-Object cmdlet compares two sets of objects. One set of objects is the Reference set, and the other set 
    is the Difference set. 
    The result of the comparison indicates whether a property value appeared only in the object from the Reference set 
    (indicated by the <= symbol), only in the object from the Difference set (indicated by the => symbol) or, if the In
    cludeEqual parameter is specified, in both objects (indicated by the == symbol).