Skip to content

Function scope prefix is not taken into account #415

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

Closed
nightroman opened this issue Dec 28, 2015 · 2 comments
Closed

Function scope prefix is not taken into account #415

nightroman opened this issue Dec 28, 2015 · 2 comments
Assignees
Milestone

Comments

@nightroman
Copy link

The script like

function global:Invoke-Test {
    42
}

causes two false positives

RuleName             Severity FileName Line Message
--------             -------- -------- ---- -------
PSUseApprovedVerbs   Warning  test.ps1 2    The cmdlet 'global:Invoke-Test' uses an unapproved verb.
PSReservedCmdletChar Warning  test.ps1 2    The cmdlet 'global:Invoke-Test' uses a reserved char in its name.

Apparently the analyser considers global: as part of the verb, not the scope prefix.

@kilasuit
Copy link
Contributor

That's a good catch - I think I can see where this has cropped in to the PSUseApprovedVerbs rule and will have a better look at the PSReservedCmdletChar rule a little later on

@quoctruong
Copy link

Thanks for the report. This is fixed with #424

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants