-
Notifications
You must be signed in to change notification settings - Fork 395
False positive on 'PSUseApprovedVerbs' when scope is declared as a prefix to the Verb-Noun combination #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Downloaded PSScriptAnalyzer for the first time earlier this evening - ModuleVersion = '1.4.0'. |
I see the issue here. If you have local:Test-Something it wont fire the issue but Local:Test-Something does. Will get this fixed with another PR shortly |
This should be accepted and fixed via #474 but in the mean time if you use the lowercase version "local:Test-Something" this will work as expected |
Understood and thanks! Forgive the noobie question, should I close the issue now or will it be closed when the defect has been addressed in the source code? |
You should leave the issue open. They'll close it when the defect has been fixed. |
Thanks, Kirk. Got it ;) |
Reference message: "The cmdlet 'Local:Test-Something' uses an unapproved verb."
Where Advanced Functions are declared with a scope prefix the rule generates a false positive.
For example:
Function Local:Test-Something {...}
Function Script:Test-SomethingElse {...}
etc.. same for Global and Private.
Not trying to justify the syntax or the appropriate use cases for it. The syntax is however supported by PowerShell, and when used to declare the function the rule clearly generates a false positive (noting that without the scope prefix these Verb-Noun combinations pass the rule).
The text was updated successfully, but these errors were encountered: