#requires -version 2.0 Function Test-CommandName { <# .Synopsis Test sample names for your PowerShell command .Description This simple function gets approved verbs and displays a list of possible combinations to help you determine the best name. You must specify a noun for your command, preferably single. The default behavior is to go through all accepted verbs, but you can limit testing to a given category. Valid categories are: "Common","Data","Lifecycle","Diagnostic","Communications","Security","Other" .Example PS C:\> test-commandname FileSec -Category Security Block-FileSec Grant-FileSec Protect-FileSec Revoke-FileSec Unblock-FileSec Unprotect-FileSec .Notes Author : Jeffery Hicks (http://jdhitsolutions.com/blog) Last Updated: 10/9/2012 Version : 0.9 .Inputs None .Outputs String .Link Get-Verb #> Param( [Parameter(Position=0,Mandatory=$True, HelpMessage="What is the noun for your command?")] [ValidateNotNullorEmpty()] [string]$Noun, [ValidateSet("All","Common","Data","Lifecycle","Diagnostic","Communications","Security","Other")] [string]$Category="All" ) if ($Category -eq "All") { #get all verb names and add to an array $verbs = Get-Verb | Select -ExpandProperty Verb } else { #get verbs that belong to the given category and add to an array of verb names $verbs = Get-Verb | Where {$_.Group -eq $Category} | Select -ExpandProperty Verb } foreach ($verb in $verbs) { <# go through each verb and display a string that represents a potential Verb-Noun name for your command #> "{0}-{1}" -f $verb,$noun } } #end Test-CommandName function