Skip to content

PSAvoidCommentHelp extent includes the entire cmdlet definition #669

@kapilmb

Description

@kapilmb
PS> Invoke-ScriptAnalyzer -ScriptDefinition @'
>> function get-foo
>> {
>>   [cmdletbinding()]
>>   param()
>> }
>> export-modulemember -function get-foo
>> '@ -Verbose -IncludeRule PSProvideCommentHelp | fl *
VERBOSE: No settings hashtable or file to consume
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSProvideCommentHelp rule.


Line                 : 1
Column               : 1
Message              : The cmdlet 'get-foo' does not have a help comment.
Extent               : function get-foo
                       {
                         [cmdletbinding()]
                         param()
                       }
RuleName             : PSProvideCommentHelp
Severity             : Information
ScriptName           :
ScriptPath           :
RuleSuppressionID    :
SuggestedCorrections :

The extent should include only the function name i.e. get-foo otherwise vscode-powershell marks the entire function definition with green squiggly lines.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions