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!

Author: Richie Lee

Full time computer guy, part time runner. Full time Dad, part time blogger. Knows a thing or two about Pokémon. Knows too much about SQL Agent. Writer of fractured sentences. Maker of the best damn macaroni cheese you've ever tasted.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s