LEARN with scripting TRAINING CREATE with SCRIPTING TOOLS SHARE in a COMMUNITY BUY Scripting Products

SAPIEN Solutions

SAPIEN homepage
SAPIEN Software
PrimalScript script editor+ide
PrimalScope script debugger
Free Tools script utilities
SAPIEN Press tech books
ScriptingAnswers.com learn+share
ScriptingOutpost.com online store
Blog.Sapien.com official blog
Contact Us

 

List PowerShell verbs

As you may be aware, PowerShell cmdlets are supposed to be named with a standard verb. I usually suggest that scripters name scripts and functions also using a standard verb, although it is not required and I certainly bend the rules from time to time.  Hopefully by now you’re saying to yourself, "Show me the verbs!"

Here’s a PowerShell oneliner:

  1. $assembly = [System.Reflection.Assembly]::LoadWithPartialName("System.Management.Automation")$assembly.GetTypes() | where { $_.Name -match "Verbs" } | foreach {  $_.GetFields() | foreach { $_.Name }   } | sort

You can also view the official MSDN documentation.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Technorati Tags: , ,

Tags: , ,

One Response to “List PowerShell verbs”

  1. Hal Rottenberg Says:

    I refer back to the MSDN article a lot. I think it’s really important that people try to confirm to this when naming their scripts and functions, at least when they are meant to be shared.

    Here’s a tiny one-liner which lists all of the verbs in use in your session at that moment (which will likely be a smaller set than your script).

    gcm | group verb

Leave a Reply


Entries (RSS) and Comments (RSS).