- 
                Notifications
    You must be signed in to change notification settings 
- Fork 403
Closed
Description
- Violation extent includes the entire function
- Incorrectly flags $Credentialtype on PSv5 and above
PS> Invoke-ScriptAnalyzer -ScriptDefinition 'function foo ([PSCredential]$credential) {write-host foo}' -IncludeRule PSUsePSCredentialT
ype | fl *
Line                 : 1
Column               : 1
Message              : The Credential parameter in 'foo' must be of type PSCredential. For PowerShell 4.0 and earlier, please define
                       a credential transformation attribute, e.g. [System.Management.Automation.Credential()], after the
                       PSCredential type attribute.
Extent               : function foo ([PSCredential]$credential) {write-host foo}
RuleName             : PSUsePSCredentialType
Severity             : Warning
ScriptName           :
ScriptPath           :
RuleSuppressionID    :
SuggestedCorrections :