Create Groups (and Examine Alias groups)

by May 18, 2010

Format-Table has a parameter called -GroupBy which creates groups based on the property you supply. For example, you can use this to examine aliases and build groups with aliases that all point to the same command:

Get-Alias | Format-Table -GroupBy Definition

You may want to sort the result before you group so as not to create duplicate groups since -GroupBy simply creates groups but does not sort:

Get-Alias | Sort-Object Definition | Format-Table -GroupBy Definition

Twitter This Tip! ReTweet this Tip!