★ wanayoo — archive 1999 https://github.com/PowerShell/PowerShell/pull/8054Nouvelle recherche | Portail wanayoo
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

Make PSVersionInfo.PSVersion and PSVersionInfo.PSEdition public #8054

Merged
merged 4 commits into from Oct 31, 2018

Conversation

Projects
None yet
4 participants
@KirkMunro
Copy link
Contributor

commented Oct 17, 2018

PR Summary

Binary module authors have been neglected, and some data that is easily accessible in PowerShell has not been exposed via public interfaces to binary module authors. I've used reflection in many cases to work around these interface shortcomings since before PowerShell became open source, and I'd like to work away from that and start making these highly important pieces of PowerShell data public so that reflection isn't needed moving forward.

This PR simply makes the static PSVersionInfo.PSVersion and PSVersionInfo.PSEdition properties public so that binary module authors building against PowerShell Core can make runtime decisions based on the version and edition as required without having to invoke PowerShell to retrieve $PSVersionTable and without having to use reflection.

PR Checklist

@KirkMunro KirkMunro requested review from BrucePay and daxian-dbw as code owners Oct 17, 2018

@KirkMunro

This comment has been minimized.

Copy link
Contributor Author

commented Oct 17, 2018

Regarding testing for this feature, I haven't added any automated testing because it was a simple interface visibility change, and I don't believe automated testing is used for that. If automated tests are required, please point me to where you would like them added (as Pester tests, or in C# unit tests). Thank you.

@iSazonov

This comment has been minimized.

Copy link
Collaborator

commented Oct 17, 2018

One note: seems it would be not compatible with Windows PowerShell SDK.

@KirkMunro

This comment has been minimized.

Copy link
Contributor Author

commented Oct 17, 2018

@iSazonov How so?

@iSazonov

This comment has been minimized.

Copy link
Collaborator

commented Oct 17, 2018

There could be applications which compiled with both Windows PowerShell SDK and PowerShell Core SDK. It is not big problem in the case - only a note for review.

@SteveL-MSFT

This comment has been minimized.

Copy link
Member

commented Oct 24, 2018

@PowerShell/powershell-committee is ok with this change

@iSazonov

This comment has been minimized.

Copy link
Collaborator

commented Oct 25, 2018

@SteveL-MSFT @adityapatwardhan How we should track adding new public APIs to PowerShell SDK?

@anmenaga

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2018

Restarted continuous-integration/appveyor/pr.

@anmenaga

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2018

@SteveL-MSFT @adityapatwardhan Please provide your input on Ilya's question.

@SteveL-MSFT

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

@iSazonov I created a new label we can use to tag PRs so we can find these easier later

@iSazonov iSazonov merged commit d9803b2 into PowerShell:master Oct 31, 2018

7 checks passed

CodeFactor No issues found.
Details
PowerShell-CI-linux #PR-8054-20181030.01 succeeded
Details
PowerShell-CI-macos #PR-8054-20181030.01 succeeded
Details
PowerShell-CI-spelling #PR-8054-20181030.01 succeeded
Details
PowerShell-CI-windows #PR-8054-20181030.01 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla All CLA requirements met.
Details

@KirkMunro KirkMunro deleted the KirkMunro:make-psversioninfo-props-public branch Jan 7, 2019

adityapatwardhan pushed a commit to adityapatwardhan/PowerShell that referenced this pull request Apr 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.