8000 PSVersionTable should have entry for OS and Platform by chunqingchen · Pull Request #3654 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

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.

8000

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

Merged
merged 1 commit into from
May 2, 2017
Merged

PSVersionTable should have entry for OS and Platform #3654

merged 1 commit into from
May 2, 2017

Conversation

chunqingchen
Copy link
Contributor

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

@mirichmo
Copy link
Member

@JamesWTruher - Please review this change as well

s_psVersionTable["CLRVersion"] = null;
#else
s_psVersionTable["CLRVersion"] = Environment.Version;
s_psVersionTable["OS"] = Environment.OSVersion;
Copy link
Member

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?

@chunqingchen
Copy link
Contributor Author

@SteveL-MSFT Thank you, your comment has been resolved.

@SteveL-MSFT SteveL-MSFT added this to the 6.0.0-beta1 milestone May 1, 2017
else
{
$OSDescription = [String][System.Environment]::OSVersion
[String]$PSVersionTable["OS"] | Should Be [System.Environment]::OSVersion
Copy link
Member

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()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

@chunqingchen
Copy link
Contributor Author

@SteveL-MSFT comment resolved.

Copy link
Member
@SteveL-MSFT SteveL-MSFT left a 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
Copy link
Member

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.

@chunqingchen
Copy link
Contributor Author

@mirichmo I have tried to modify all the tab previous file contains into space.

@mirichmo
Copy link
Member
mirichmo commented May 1, 2017

Thanks. I'll merge it once it passes CI. I restarted since Travis failed with a possible unrelated issue.

@mirichmo mirichmo merged commit 9051ca1 into PowerShell:master May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PSVersionTable should have entry for OS
4 participants
0