Skip to content
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

Ability to bind concerned PowerShell version to a rule #2050

Open
iRon7 opened this issue Dec 17, 2024 · 0 comments
Open

Ability to bind concerned PowerShell version to a rule #2050

iRon7 opened this issue Dec 17, 2024 · 0 comments

Comments

@iRon7
Copy link

iRon7 commented Dec 17, 2024

It might be helpful that in the case a rule only applies to a specific (minimum) PowerShell versions as for e.g.:

And new request/issues:

to have the possibility to add that (minimum) PowerShell version (e.g. MininumPowerShellVersion) to that rule.

Meaning e.g. the AvoidUsingWMICmdlet rule might have MininumPowerShellVersion set to 3.0
This would add the possibility for two additional features:

  • Suppressing the specific rule by using the #Requires -Version x.x statement.
    E.g.:
    • adding #Requires -Version 2.0 would suppress the AvoidUsingWMICmdlet rule
    • adding #Requires -Version 7.0 would allow the use of `e (suppress the proposed UseCompatibleStrings rule)
  • A general UseRequiresStatement rule when a rule with a minimal version applies and the #Requires -Version x.x is not set (or set incorrectly)
    E.g. if any of the rules applies, it generate a warning that the #Requires -Version x.x statement should be set.
@iRon7 iRon7 changed the title Ability to bind concerned PowerShell version range to a rule Ability to bind concerned PowerShell version to a rule Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant