#PSTip Most frequently used -Verb values

In previous tip we saw how to receive all -Verb values for registered extensions. But what if we want to see all available values?
We have to modify the original command by removing the format operator. Further, we can also use Group-Object cmdlet to see count of these values (actions).

cmd /c assoc |
ForEach { $ext = ($_ -split '=')[0]; (New-Object Diagnostics.ProcessStartInfo -Argument "test$ext").Verbs } |
Group-Object |
Sort-Object Count -Desc |
Format-Table Name, Count -Auto

Name                                    Count
----                                    -----
open                                      438
shell                                     114
print                                     105
AddToPlaylistVLC                           74
PlayWithVLC                                74

 (some lines removed)

Uninstall                                   1
Author                                      1
Repair                                      1

About the author: David Moravec

I am in IT industry for 15 years, last 10 years working mainly with Microsoft management technologies. I Work in one of the biggest international accounting companies as administrator responsible for System Center Configuration Manager. I like to automate my infrastructure-related tasks with windows PowerShell. Author and speaker for Microsoft Czech Republic. I'm Running my own blog at PowerShell.cz. You can reach me on Twitter at @makovec

Related Posts