PowerShell Basics: 2 Utility cmdlets

 

The utility cmdlets are the glue that we use to bind our actions together on the PowerShell pipeline. We can easily discover the list of utility cmdlets by using

Get-Command *-object

I split the utility cmdlets into two groups.  The first group I use all of the time

ForEach-Object
Select-Object
Sort-Object
Where-Object

The second group provides functionality that I don’t use as much but saves me a ton of time when I need it

Compare-Object
Group-Object
Measure-Object
New-Object
Tee-Object

PowerShell’s verb-noun naming convention for cmdlets should be sufficient to figure out what each of them does.  Check out the help file for these cmdlets.  Another good reference is the web cast I did a few months back

Details from here http://msmvps.com/blogs/richardsiddaway/archive/2011/02/08/tonight-s-slides-and-recording.aspx

One Response to PowerShell Basics: 2 Utility cmdlets

  • Mike Shepard says:

    I find that group-object is extremely handy when processing a bunch of items. I frequently end up grouping things by computername or userID. Also, coming from a SQL background, it was surprising to do a group-object and still being able to “drill-down” into the items in the group.

Leave a Reply