#PSTip Grouping objects
The Group-Object cmdlet lets you group objects based on the value of a specified property. For example:
|
|
This command gets the services and groups them by status. In addition to the Name and Count properties, you get back the objects of each group. If all you need is a Name/Count pair then you can tell Group-Object to omit the members of each group. The command will return the result much faster.
|
|
Sometimes you’d need to group objects based on a part of a property value. Luckily, Group-Object enables us to do so using an expression. The following command will help you to find out how many files in the current directory were changed per month:
|
|