-
Notifications
You must be signed in to change notification settings - Fork 388
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
psusecompatibleSyntax goes a bit too far. #2041
Comments
It might also be considered to link this type of rules to the Originally posted by @iRon7 in #2046 (comment) |
YES . If the solution were "Put a requires statement in if your code uses feature only in XX" (which only appeared if there was no such statement) that would be ideal. |
You can specify the target versions to not get errors for older versions |
Good to know, but it would be still be better if V3/4 checks were off by default, and/or there was check for requires. |
I think because the rule is off by default, intent was to start with most versions and if people want they can overide. Defaults will also be debatable but I agree with original offer to offer the most analysis by default because the reality is that a lot of people use defaults and thus would never benefit from it |
I think I created this because on some system I was on after an update it started complaining that I'd used classes or |
Not sure if something has changed but I've noticed this recently, and it the hadn't registered before
Summary of the new feature
I'm seeing this
The constructor syntax '[type]::new()' is not available by default in PowerShell versions 3,4
I got the same with
class
We're trying to get people to move on from Windows PowerShell 5, but that has been around for 8 yeas or so and it might be time to review the pre-PowerShell 5 features people are told to avoidProposed technical implementation details (optional)
Drop checks for PowerShell 3 compatibility.
What is the latest version of PSScriptAnalyzer at the point of writing
1.22.0
The text was updated successfully, but these errors were encountered: