An Improved Get-Verb Command

A recommended best practice for PowerShell scripting, especially when developing functions, is to follow the standard Verb-Noun naming convention. The Verb  should be a value from the list of approved .NET verbs. The easy way to see that list is with the Get-Verb cmdlet. The result will also indicate the verb group or category like Security or Lifecycle. If you wanted to filter for a particular group you needed to use a Where-Object expression. It really isn’t that difficult but I decided to make a my own version of Get-Verb that would let you specify one or more groups.

The function is essentially a wrapper for Get-Verb. It uses the same parameters plus my addition. The help is also from Get-Verb, although I modified it slightly to reflect my version of the command. You can use Get-MyVerb as you would Get-Verb or you can specify one or more groups.

get-myverb

The last improvement, is that if you run help for Get-MyVerb with -Online you’ll get the MSDN documentation about .NET verbs which goes into detail. I think you will find it helpful.

Enjoy and as always, comments or questions are welcome.

One thought on “An Improved Get-Verb Command

Comments are closed.