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:
$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.
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
There is a semi-colon missing:
“…LoadWithPartialName(“System.Management.Automation”);$assembly.Ge
I fixed the command. Thanks for the catch. Sometimes formatting screws things up and things get dropped or borked.