Skip to content

Conversation

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

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

@KirkMunro
Copy link
Contributor Author

@iSazonov How so?

@iSazonov
Copy link
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
Member

@PowerShell/powershell-committee is ok with this change

@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 Oct 24, 2018
@iSazonov
Copy link
Collaborator

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

@anmenaga
Copy link

Restarted continuous-integration/appveyor/pr.

@anmenaga
Copy link

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

@SteveL-MSFT
Copy link
Member

@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
@KirkMunro KirkMunro deleted the make-psversioninfo-props-public branch January 7, 2019 21:22
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