Skip to content

Raise minimum version of PowerShell Core from 6.0.2 to 6.1.0 or 6.1.3 #1159

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
bergmeister opened this issue Mar 1, 2019 · 3 comments · Fixed by #1165
Closed

Raise minimum version of PowerShell Core from 6.0.2 to 6.1.0 or 6.1.3 #1159

bergmeister opened this issue Mar 1, 2019 · 3 comments · Fixed by #1165

Comments

@bergmeister
Copy link
Collaborator

bergmeister commented Mar 1, 2019

Currently the minimum version of PSCore required by PSSA is 6.0.2 (because previous Nuget packages of SMA had a bug).
Due to PSCore 6.0 reaching its end of life this month (as far as I am aware), should we bump the minimum required version to 6.1.0. or even 6.1.3?
We have 2 places in code that we'd adapt:

  • The smoke check here to give a user facing message
    if ($PSVersionTable.PSVersion -lt [version]'6.0.2') {
    throw "Minimum supported version of PSScriptAnalyzer for PowerShell Core is 6.0.2 but current version is '$($PSVersionTable.PSVersion)'. Please update PowerShell Core."
  • The SMA reference here (PSSA is not on PowerShellStandard, which is non-trivial to start to use in this repo and would be a bigger task)
    <PackageReference Include="System.Management.Automation" Version="6.0.2" />

Any opinions @JamesWTruher @rjmholt @SteveL-MSFT ?

@rjmholt
Copy link
Contributor

rjmholt commented Mar 2, 2019

Definitely worth moving off 6.0.2 to 6.1.3.

Moving to PSStandard is nice but is a fairly large effort.

You'd also lose a lot going to PSStandard for PS 3. For script rules that use AstVisitor2 I don't think it would be possible -- you can't inherit from a type by reflection. Instantly you'd lose most of the benefit from PSUseCompatibleSyntax for example. Those rules that use it would need to be rewritten to use the FindAll method instead.

The functional APIs on the other hand are easy to work with -- easily cached runtime tests determine what PowerShell version you're on, and then you can use reflection when you need to.

@bergmeister
Copy link
Collaborator Author

Yh, I agree that moving to PSStandard (which I would only do for the compilation against v5 and v6) is another big chunk of work.
Do you think it is too aggressive to require the latest patched version of PowerShell 6.1? There will be quite a few software systems (e.g. build servers) and users that haven't patched yet. 6.1.3 is quite recent, maybe something like 6.1.2 is more practical?

@rjmholt
Copy link
Contributor

rjmholt commented Mar 4, 2019

I think requiring 6.1 without being specific about the patch version (if possible) is the right way to go. It's how MSBuild and npm would go, and the idea of the patch is that there are no breaking changes in 6.1 from 6.1.0 to 6.1.3.

But with 6.0 being EOL, I think we are forced to give up 6.0 support (from the perspective of releasing "maintained" and "supported" software ourselves)

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