Don’t Be A Jerk, Use Approved Verbs in PowerShell

Today I’m going on a mini rant about people abusing PowerShell, specifically to do with naming PowerShell functions. If you’re going to take the trouble to write PowerShell functions and add them to a module for others to have access to, please, don’t be a jerk, use a verb from the approved verbs list that is freely and readily available on the MSDN Developers site, or even by typing “get-verb” in the console.

There is nothing more infuriating than loading a module, only to be greeted with this:

2014-11-11 20_50_14

This is what happens when someone creates functions with unapproved verbs, which makes them harder to discover. This sounds like I’m being uptight, and it is, but the reason of having approved verbs is that someone who can have a good idea what the function would do; you can be pretty confident that a function called “remove partitions” is going to drop the partitions. And something like “get-partitions” is going to retrieve something but not modify it, unless of course the person who wrote the module made a lousy choice when picking a verb. But at best PowerShell does its best to help you make the best choice.

Oh, and as for the offending unapproved verb? Turns out it was called “emergency”, which really does highlight just why you ought to use approved verbs; something so important to be called “emergency” ought to be easily discoverable.

Happy scripting!

Leave a Reply

Your email address will not be published. Required fields are marked *