-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Make PSVersionInfo.PSVersion and PSVersionInfo.PSEdition public #8054
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
Conversation
|
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. |
|
One note: seems it would be not compatible with Windows PowerShell SDK. |
|
@iSazonov How so? |
|
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. |
|
@PowerShell/powershell-committee is ok with this change |
|
@SteveL-MSFT @adityapatwardhan How we should track adding new public APIs to PowerShell SDK? |
|
Restarted |
|
@SteveL-MSFT @adityapatwardhan Please provide your input on Ilya's question. |
|
@iSazonov I created a new label we can use to tag PRs so we can find these easier later |
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
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests