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

psusecompatibleSyntax goes a bit too far. #2041

Open
jhoneill opened this issue Nov 1, 2024 · 2 comments
Open

psusecompatibleSyntax goes a bit too far. #2041

jhoneill opened this issue Nov 1, 2024 · 2 comments

Comments

@jhoneill
Copy link

jhoneill commented Nov 1, 2024

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 avoid

Proposed 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

@iRon7
Copy link

iRon7 commented Dec 16, 2024

It might also be considered to link this type of rules to the #Requires -Version x.x statement.

Originally posted by @iRon7 in #2046 (comment)

@jhoneill
Copy link
Author

It might also be considered to link this type of rules to the #Requires -Version x.x statement.

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.

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

2 participants