Create Groups (and Examine Alias groups)

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!


Posted May 18 2010, 08:00 AM by ps1

Comments

Twitter Trackbacks for Create Groups (and Examine Alias groups) - Power Tips - PowerShell.com [powershell.com] on Topsy.com wrote Twitter Trackbacks for Create Groups (and Examine Alias groups) - Power Tips - PowerShell.com [powershell.com] on Topsy.com
on 05-18-2010 10:26 AM

Pingback from  Twitter Trackbacks for                 Create Groups (and Examine Alias groups) - Power Tips - PowerShell.com         [powershell.com]        on Topsy.com

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.