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 Verb Group ---- ----- Add Common Clear Common Close Common Copy Common Enter Common Exit Common Find Common Format Common Get Common Hide Common Join Common Lock Common Move Common New Common Open Common Optimize Common Pop Common Push Common Redo Common Remove Common Rename Common Reset Common Resize Common Search Common Select Common Set Common Show Common Skip Common Split Common Step Common Switch Common Undo Common Unlock Common Watch Common Backup Data Checkpoint Data Compare Data Compress Data Convert Data ConvertFrom Data ConvertTo Data Dismount Data Edit Data Expand Data Export Data Group Data Import Data Initialize Data Limit Data Merge Data Mount Data Out Data Publish Data Restore Data Save Data Sync Data Unpublish Data Update Data Approve Lifecycle Assert Lifecycle Complete Lifecycle Confirm Lifecycle Deny Lifecycle Disable Lifecycle Enable Lifecycle Install Lifecycle Invoke Lifecycle Register Lifecycle Request Lifecycle Restart Lifecycle Resume Lifecycle Start Lifecycle Stop Lifecycle Submit Lifecycle Suspend Lifecycle Uninstall Lifecycle Unregister Lifecycle Wait Lifecycle Debug Diagnostic Measure Diagnostic Ping Diagnostic Repair Diagnostic Resolve Diagnostic Test Diagnostic Trace Diagnostic Connect Communications Disconnect Communications Read Communications Receive Communications Send Communications Write Communications Block Security Grant Security Protect Security Revoke Security Unblock Security Unprotect Security Use Other
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 Verb Group ---- ----- Add Common Approve Lifecycle Assert Lifecycle Backup Data Block Security Checkpoint Data Clear Common Close Common Compare Data Complete Lifecycle Compress Data Confirm Lifecycle Connect Communications Convert Data ConvertFrom Data ConvertTo Data Copy Common Debug Diagnostic Deny Lifecycle Disable Lifecycle Disconnect Communications Dismount Data Edit Data Enable Lifecycle Enter Common Exit Common Expand Data Export Data Find Common Format Common Get Common Grant Security Group Data Hide Common Import Data Initialize Data Install Lifecycle Invoke Lifecycle Join Common Limit Data Lock Common Measure Diagnostic Merge Data Mount Data Move Common New Common Open Common Optimize Common Out Data Ping Diagnostic Pop Common Protect Security Publish Data Push Common Read Communications Receive Communications Redo Common Register Lifecycle Remove Common Rename Common Repair Diagnostic Request Lifecycle Reset Common Resize Common Resolve Diagnostic Restart Lifecycle Restore Data Resume Lifecycle Revoke Security Save Data Search Common Select Common Send Communications Set Common Show Common Skip Common Split Common Start Lifecycle Step Common Stop Lifecycle Submit Lifecycle Suspend Lifecycle Switch Common Sync Data Test Diagnostic Trace Diagnostic Unblock Security Undo Common Uninstall Lifecycle Unlock Common Unprotect Security Unpublish Data Unregister Lifecycle Update Data Use Other Wait Lifecycle Watch Common Write Communications
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 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 Watch Write
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 Watch Write
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.