Search Wiki:

UseOnlyApprovedCharactersInVerbsAndNouns


TypeName UseOnlyApprovedCharactersInVerbsAndNouns
CheckId PS1005
Error-Level Error
Category Microsoft.PowerShell
Certainty 95%
BreakingChangeDepends on fix
Cause A cmdlet name includes prohibited characters.
Rule descriptionWhen naming cmdlets, do not use any of the following characters: # , ( ) { } & - / \ $ ^ ; : " ' < > | ? @ ` * % + = ~
How to fix violations Change the cmdlet verb and/or noun so that none of the prohibited characters are used. To mitigate the resulting breaking change, add a command alias that associates the original name with the new name.
When to exclude warnings Do not suppress warnings from this rule.
Related rules (None)
See also FxCop Rules for Windows PowerShell

Examples


This cmdlet uses a prohibited character (-) in the noun.
    [Cmdlet("Get", "Helper-Scripts")]
    public class GetHelperScriptsCommand : PSCmdlet
    {
        // [...]
    }

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