Skip to content

Make PSVersionInfo.PSVersion and PSVersionInfo.PSEdition public - #8054

Merged
Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
KirkMunro:make-psversioninfo-props-public
Oct 31, 2018
Merged

Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
KirkMunro:make-psversioninfo-props-public

Conversation

@KirkMunro

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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 Ilya (iSazonov) added the Review - Committee The PR/Issue needs a review from the PowerShell Committee label Oct 17, 2018
@iSazonov

Copy link
Copy Markdown
Collaborator

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

@KirkMunro

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) How so?

@iSazonov

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Member

@PowerShell/powershell-committee is ok with this change

@SteveL-MSFT Steve Lee (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 Oct 24, 2018
@iSazonov

Copy link
Copy Markdown
Collaborator

Steve Lee (@SteveL-MSFT) Aditya Patwardhan (@adityapatwardhan) How we should track adding new public APIs to PowerShell SDK?

@anmenaga

Copy link
Copy Markdown

Restarted continuous-integration/appveyor/pr.

@anmenaga

Copy link
Copy Markdown

Steve Lee (@SteveL-MSFT) Aditya Patwardhan (@adityapatwardhan) Please provide your input on Ilya's question.

@SteveL-MSFT

Copy link
Copy Markdown
Member

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

@iSazonov
Ilya (iSazonov) merged commit d9803b2 into PowerShell:master Oct 31, 2018
@KirkMunro
Kirk Munro (KirkMunro) deleted the make-psversioninfo-props-public branch January 7, 2019 21:22
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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 New-Public-API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants