Search Wiki:

UsePascalCasingInVerbsAndNouns


TypeName UsePascalCasingInVerbsAndNouns
CheckId PS1008
Error-Level Warning
Category Microsoft.PowerShell
Certainty 80%
BreakingChangeDepends on fix
Cause A cmdlet name does not use proper Pascal casing.
Rule description Use Pascal casing for cmdlet names. Do not use special characters, such as an underscore character (_), to separate words in a compound noun.
How to fix violations In the CmdletAttribute attibute, use Pascal casing for the command verb and noun. Eliminate special characters that are used to separate words in a cmdlet noun. Windows PowerShell is case-insensitive, so changing only the case is not a breaking change. However, removing an underscore or other separation character will cause a breaking change. To mitigate the effects of a 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 UseSingularParameterNames
See also FxCop Rules for Windows PowerShell

Examples


This cmdlet does not use proper Pascal casing in its verb (“get”) and noun (“helper_scripts”).
    [Cmdlet("get", "helper_scripts")]
    public class GetHelperScriptsCommand : PSCmdlet
    {
        // [...]
    }

To fix, change the verb to “Get” and the noun to “HelperScripts”.
    [Cmdlet("Get", "HelperScripts")]
    public class GetHelperScriptsCommand : PSCmdlet
    {
        // [...]
    }


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