You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
It might be helpful that in the case a rule only applies to a specific (minimum) PowerShell versions as for e.g.:
AvoidUsingWMICmdlet
And new request/issues:
UseCompatibleStrings
UseCompatibleSyntax
AvoidNewObjectCmdlet
to have the possibility to add that (minimum) PowerShell version (e.g.
MininumPowerShellVersion
) to that rule.Meaning e.g. the
AvoidUsingWMICmdlet
rule might haveMininumPowerShellVersion
set to3.0
This would add the possibility for two additional features:
#Requires -Version x.x
statement.E.g.:
#Requires -Version 2.0
would suppress theAvoidUsingWMICmdlet
rule#Requires -Version 7.0
would allow the use of`e
(suppress the proposedUseCompatibleStrings
rule)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.The text was updated successfully, but these errors were encountered: