Search Wiki:

UseOnlyStandardVerbs


TypeName UseOnlyStandardVerbs
CheckId PS1001
Error-Level Error
Category Microsoft.PowerShell
Certainty 95%
BreakingChangeDepends on fix
Cause The verb in the cmdlet name is not an approved cmdlet verb.
Rule descriptionThe verb part of a cmdlet or function name must be taken from the set of approved verbs for Windows PowerShell cmdlets. For a list of approved verbs, see "Cmdlet Verbs" in the MSDN library at http://go.microsoft.com/fwlink/?LinkID=160773.
How to fix violations Change the name of the class that implements the cmdlet.
When to exclude warnings Do not suppress warnings from this rule. When users import modules that include commands with unapproved verbs in their names, Windows PowerShell generates a warning that notifies the user.
Related rules (None)
See also FxCop Rules for Windows PowerShell

Examples


Example of a cmdlet that violates this rule. "Append" is not an approved verb.
    [Cmdlet("Append", "Content")]
    public class AppendContentCommand : PSCmdlet
    {
        // [...]
    }

// Example of a cmdlet that follows this rule. "Add" is an approved verb.
    [Cmdlet("Append", "Content")]
    public class AppendContentCommand : PSCmdlet
    {
        // [...]
    }

Back to FxCop Rules for Windows PowerShell.
Last edited Mar 26 2010 at 6:57 PM  by JuneB, version 2
Updating...
Page view tracker