So, earlier tonight, my wife, daughter, and me were on the couch. My wife was cleaning out her purse as my daughter helped her organize her change. Me, I was briefly on my phone and looking for a quick list of approved PowerShell verbs. As you likely know, if we create our own cmdlets and functions, we should use an approved verb for the verb, dash, singular noun naming convention: Get-Process, Set-ADUser, Checkpoint-Computer… okay, it’s not always a verb, but you know what I mean.
I couldn’t believe it; I couldn’t just find a simple list of all the verbs, close to one another, and without any explanations. You know the list, the one you basically get when you run Get-Verb. I suppose I should mention that all I had was my phone. There wasn’t a computer close by, and that’s, why I’m putting up a list of the approved verbs (as of PowerShell 5.1 on Windows 8.1), on my website.
Here’s the standard, Get-Verb output that includes the Name and Group. After that, I’ll include the same list, a few more ways. Maybe, just maybe it’ll be here when you, or I, need it next.
PS > Get-Verb
As you may have noticed in the previous results, the default output is sorted by the Group. Here comes a second list; however, this list will be sorted by the Verb. I can already see how this may be helpful. In fact, this is the list I was probably after.
PS > Get-Verb | Sort-Object -Property Verb
In this example, all I want to return is the verbs. Nine times out of 10, the group doesn’t make a difference to me.
PS > (Get-Verb | Sort-Object -Property Verb).Verb
This next example uses Format-Wide so that my results are in columns. Notice how the sorting goes across the rows, as opposed to down the columns. There’s should probably be a built-in way to handle that behavior. Yuck.
PS > Get-Verb | Sort-Object -Property Verb | Format-Wide -Column 4
Add Approve Assert Backup
Block Checkpoint Clear Close
Compare Complete Compress Confirm
Connect Convert ConvertFrom ConvertTo
Copy Debug Deny Disable
Disconnect Dismount Edit Enable
Enter Exit Expand Export
Find Format Get Grant
Group Hide Import Initialize
Install Invoke Join Limit
Lock Measure Merge Mount
Move New Open Optimize
Out Ping Pop Protect
Publish Push Read Receive
Redo Register Remove Rename
Repair Request Reset Resize
Resolve Restart Restore Resume
Revoke Save Search Select
Send Set Show Skip
Split Start Step Stop
Submit Suspend Switch Sync
Test Trace Unblock Undo
Uninstall Unlock Unprotect Unpublish
Unregister Update Use Wait
In the next example, I’ll try the -join operator.
PS > (Get-Verb | Sort-Object -Property Verb).Verb -join ', '
Add, Approve, Assert, Backup, Block, Checkpoint, Clear, Close, Compare, Complete, Compress, Confirm, Connect, Convert, C
onvertFrom, ConvertTo, Copy, Debug, Deny, Disable, Disconnect, Dismount, Edit, Enable, Enter, Exit, Expand, Export, Find
, Format, Get, Grant, Group, Hide, Import, Initialize, Install, Invoke, Join, Limit, Lock, Measure, Merge, Mount, Move,
New, Open, Optimize, Out, Ping, Pop, Protect, Publish, Push, Read, Receive, Redo, Register, Remove, Rename, Repair, Requ
est, Reset, Resize, Resolve, Restart, Restore, Resume, Revoke, Save, Search, Select, Send, Set, Show, Skip, Split, Start
, Step, Stop, Submit, Suspend, Switch, Sync, Test, Trace, Unblock, Undo, Uninstall, Unlock, Unprotect, Unpublish, Unregi
ster, Update, Use, Wait, Watch, Write
Also yuck. So yeah, I thought that might turn out better. Well, I’ve got it now — a place to find all the current verbs as of this writing, if I’m ever sitting on the couch, watching two of my favorite people, and unable to decide what verb to use for a new PowerShell tool.