Poweshell-Commands


Example


Compare-Object 
ForEach-Object	
Group-Object


NAME Compare-Object SYNOPSIS Compares two sets of objects. SYNTAX Compare-Object [-ReferenceObject] [-DifferenceObject] [-CaseSensitive] [-Culture ] [-ExcludeDifferent] [-IncludeEqual] [-Pas sThru] [-Property ] [-SyncWindow ] [] DESCRIPTION The Compare-Object cmdlet compares two sets of objects. One set of objects is t he Reference set, and the other set is the Difference set. The result of the comparison indicates whether a property value appeared only i n the object from the Reference set (indicated by the <= symbol), only in the o bject from the Difference set (indicated by the => symbol) or, if the IncludeEq ual parameter is specified, in both objects (indicated by the == symbol). RELATED LINKS Online version: http://go.microsoft.com/fwlink/?LinkID=113286 Group-Object Measure-Object Sort-Object ForEach-Object New-Object Select-Object Tee-Object Where-Object REMARKS To see the examples, type: "get-help Compare-Object -examples". For more information, type: "get-help Compare-Object -detailed". For technical information, type: "get-help Compare-Object -full". ------------------------------- NAME ForEach-Object SYNOPSIS Performs an operation against each of a set of input objects. SYNTAX ForEach-Object [-Process] [-Begin ] [-End ] [-InputObject ] [] DESCRIPTION The ForEach-Object cmdlet performs an operation on each of a set of input objec ts. The input objects can be piped to the cmdlet or specified by using the Inpu tObject parameter. The operation to perform is described within a script block that is provided to the cmdlet as the value of the Process parameter. The script block can contain any Windows PowerShell script. Within the script block, the current input object is represented by the $_ vari able. In addition to using the script block that describes the operations to be carri ed out on each input object, you can provide two additional script blocks. One, specified as the value of the Begin parameter, runs before the first input obj ect is processed. The other, specified as the value of the End parameter, runs after the last input object is processed. The results of the evaluation of all the script blocks, including the ones spec ified with Begin and End, are passed down the pipeline. RELATED LINKS Online version: http://go.microsoft.com/fwlink/?LinkID=113300 REMARKS To see the examples, type: "get-help ForEach-Object -examples". For more information, type: "get-help ForEach-Object -detailed". For technical information, type: "get-help ForEach-Object -full". ---------------------------- NAME Group-Object SYNOPSIS Groups objects that contain the same value for specified properties. SYNTAX Group-Object [-AsHashTable] [-AsString] [[-Property] ] [-CaseSensitiv e] [-Culture ] [-InputObject ] [-NoElement] [] DESCRIPTION The Group-Object cmdlet displays objects in groups based on the value of a spec ified property. Group-Object returns a table with one row for each property val ue and a column that displays the number of items with that value. If you specify more than one property, Group-Object first groups them by the va lues of the first property, and then, within each property group, it groups by the value of the next property. RELATED LINKS Online version: http://go.microsoft.com/fwlink/?LinkID=113338 REMARKS To see the examples, type: "get-help Group-Object -examples". For more information, type: "get-help Group-Object -detailed". For technical information, type: "get-help Group-Object -full".

Copy and Try it