Skip to content

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Oct 21, 2022

Remove the following unsupported versions from $PSVersionTable.PSCompatibleVersions:

Version End-of-support
5.0 October 10, 2017*
6.0 February 13, 2019
6.1 September 28, 2019
6.2 September 4, 2020
7.1 May 8, 2022

The following versions were not removed as they are apparently still supported by Microsoft:

Version
1.0 Optional component of Windows Server 2008, which is supported under Extended Security Updates on Azure until January 9, 2024.
2.0 Integrated in Windows Server 2008 R2, which is supported under Extended Security Updates on Azure until January 9, 2024.

*Installed by default on Windows 10 version 1511, which is out-of-support since October 10, 2017. See Windows PowerShell System Requirements.

@xtqqczze
Copy link
Contributor Author

What is the actual purpose of $PSVersionTable.PSCompatibleVersions?

Documentation says: "Versions of PowerShell that are compatible with the current version"

@xtqqczze xtqqczze marked this pull request as ready for review October 21, 2022 23:11
@xtqqczze xtqqczze changed the title Remove 1.0 and 2.0 from PSCompatibleVersions Remove unsupported versions from PSCompatibleVersions Oct 22, 2022
@xtqqczze
Copy link
Contributor Author

xtqqczze commented Oct 22, 2022

As PSv1 and PSv2 will be technically still supported, they will not be removed as part of this PR without confirmation from PowerShell committee.

cc: @daxian-dbw

@xtqqczze xtqqczze marked this pull request as draft October 22, 2022 21:23
@xtqqczze xtqqczze force-pushed the PSCompatibleVersions branch from 4162924 to 8415e01 Compare October 22, 2022 21:25
@xtqqczze xtqqczze closed this Oct 22, 2022
@xtqqczze
Copy link
Contributor Author

restarting tests

@xtqqczze xtqqczze reopened this Oct 22, 2022
@pull-request-quantifier-deprecated

This PR has 9 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Small
Size       : +2 -7
Percentile : 3.6%

Total files changed: 2

Change summary by file extension:
.cs : +1 -6
.ps1 : +1 -1

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detected.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@xtqqczze xtqqczze marked this pull request as ready for review October 26, 2022 01:06
@ghost ghost added the Review - Needed The PR is being reviewed label Nov 2, 2022
@ghost
Copy link

ghost commented Nov 2, 2022

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@daxian-dbw daxian-dbw added the Review - Committee The PR/Issue needs a review from the PowerShell Committee label Nov 7, 2022
@daxian-dbw
Copy link
Member

@PowerShell/powershell-committee Need the committee to review whether we want to make changes to the PSCompatibleVersions key of $PSVersionTable.

@ghost ghost removed the Review - Needed The PR is being reviewed label Nov 7, 2022
@SteveL-MSFT
Copy link
Member

PS-Committee will discuss this today

@SteveL-MSFT
Copy link
Member

@PowerShell/powershell-committee discussed this. This member advertises compatibility (language, not cmdlets) and not support, so we recommend not making any changes to this member despite some older versions of PowerShell are no longer supported, they are still compatible if you have older scripts.

Our request is to update the table to include only this information:

PS> $psversiontable.PSCompatibleVersions

Major  Minor  Build  Revision
-----  -----  -----  --------
1      0      -1     -1
2      0      -1     -1
3      0      -1     -1
3      0      -1     -1
4      0      -1     -1
5      0      -1     -1
5      1      10032  0
6      0      -1     -1
7      0      -1     -1

And I'll open a corresponding doc bug indicating that 6.0 and 7.0 means all minor versions are compatible (as [System.Version] requires a minor version element).

@SteveL-MSFT SteveL-MSFT added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Nov 9, 2022
@daxian-dbw
Copy link
Member

image

Let's just use 5.1 without the build and patch values. The actual build and patch values keep changing with newer windows releases. For example, $PSVersionTable in Windows PowerShell on my Win11 machine looks like this:

image

@kilasuit
Copy link
Collaborator

I disagree with this PR as the value is for compatible versions, not supported versions and to answer @xtqqczze question

What is the actual purpose of $PSVersionTable.PSCompatibleVersions?

This is meant to mean that code written for these prior versions of PowerShell is compatible with the current version of the PowerShell engine. Note I state engine, not modules or cmdlets/functions here.

Documentation says: "Versions of PowerShell that are compatible with the current version"

This could be made clearer and should be raised as a documentation issue cc @sdwheeler / @michaeltlombardi

@iSazonov
Copy link
Collaborator

This member advertises compatibility (language, not cmdlets) and not support

Who and how uses the information in real world? Can anybody demonstrate a project/module where this is used?

@daxian-dbw
Copy link
Member

daxian-dbw commented Nov 14, 2022

@iSazonov Here are the results when searching on grep.app: https://grep.app/search?q=PSCompatibleVersions

@xtqqczze Can you please update this PR based on #18346 (comment) and #18346 (comment)?

Search across a half million git repos. Search by regular expression.

@iSazonov
Copy link
Collaborator

iSazonov commented Nov 15, 2022

@iSazonov Here are the results when searching on grep.app: https://grep.app/search?q=PSCompatibleVersions

I see only one tool where it is used https://github.com/icsharpcode/ILSpy/blob/master/BuildTools/update-assemblyinfo.ps1

Search across a half million git repos. Search by regular expression.
GitHub
.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform! - ILSpy/update-assemblyinfo.ps1 at master · icsharpcode/ILSpy

@SteveL-MSFT
Copy link
Member

This member was there probably since 1.0 and at that time, it was intended to be future proof in that the team may consider breaking changes to the language, however, it's probably not something scripts should use and instead should do feature detection and explicitly test against versions of PowerShell they want to support. With that said, we can't remove it for compat reasons, but if the Build is being updated for each version of Windows, then I would agree we should change that to -1 (not specified) as well.

@xtqqczze
Copy link
Contributor Author

Superseded by #18635.

@xtqqczze xtqqczze closed this Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Committee-Reviewed PS-Committee has reviewed this and made a decision Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants