Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upMake PSVersionInfo.PSVersion and PSVersionInfo.PSEdition public #8054
Conversation
KirkMunro
added some commits
Oct 17, 2018
KirkMunro
requested review from
BrucePay and
daxian-dbw
as
code owners
Oct 17, 2018
This comment has been minimized.
This comment has been minimized.
|
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
added
the
Review - Committee
label
Oct 17, 2018
This comment has been minimized.
This comment has been minimized.
|
One note: seems it would be not compatible with Windows PowerShell SDK. |
This comment has been minimized.
This comment has been minimized.
|
@iSazonov How so? |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
@PowerShell/powershell-committee is ok with this change |
SteveL-MSFT
added
Committee-Reviewed
and removed
Review - Committee
labels
Oct 24, 2018
iSazonov
approved these changes
Oct 25, 2018
This comment has been minimized.
This comment has been minimized.
|
@SteveL-MSFT @adityapatwardhan How we should track adding new public APIs to PowerShell SDK? |
This comment has been minimized.
This comment has been minimized.
|
Restarted |
This comment has been minimized.
This comment has been minimized.
|
@SteveL-MSFT @adityapatwardhan Please provide your input on Ilya's question. |
SteveL-MSFT
added
the
New-Public-API
label
Oct 29, 2018
This comment has been minimized.
This comment has been minimized.
|
@iSazonov I created a new label we can use to tag PRs so we can find these easier later |
KirkMunro commentedOct 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
.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