-
Notifications
You must be signed in to change notification settings - Fork 7.6k
PSVersionTable should have entry for OS and Platform #3654
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.
8000By 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
Conversation
@JamesWTruher - Please review this change as well |
s_psVersionTable["CLRVersion"] = null; | ||
#else | ||
s_psVersionTable["CLRVersion"] = Environment.Version; | ||
s_psVersionTable["OS"] = Environment.OSVersion; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this use .ToString() as OSVersion is an object?
@SteveL-MSFT Thank you, your comment has been resolved. |
else | ||
{ | ||
$OSDescription = [String][System.Environment]::OSVersion | ||
[String]$PSVersionTable["OS"] | Should Be [System.Environment]::OSVersion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of me thinks we shouldn't make any changes for FullCLR, but if we're making the change it seems this line would fail as the right hand side should use ToString()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
@SteveL-MSFT comment resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -1,6 +1,6 @@ | |||
Describe "PSVersionTable" -Tags "CI" { | |||
It "Should have version table entries" { | |||
$PSVersionTable.Count | Should Be 9 | |||
$PSVersionTable.Count | Should Be 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the indentation within this file. It looks like you may have added tab characters instead of spaces. My comment applies to all changes made within this file.
@mirichmo I have tried to modify all the tab previous file contains into space. |
Thanks. I'll merge it once it passes CI. I restarted since Travis failed with a possible unrelated issue. |
This is to resolve #1635
$PSVersionTable.OS now outputs [Runtime.InteropServices.RuntimeInformation]::OSDescription ([System.Environment]::OSVersion if not under coreclr)
$PSVersionTable.Platform outputs [System.Environment]::OSVersion.Platform