Title: Make `$PSVersionTable` report correct and relevant OS information, underlying .NET version, CPU architecture, OS display version on Windows · Issue #19121 · PowerShell/PowerShell · GitHub
Open Graph Title: Make `$PSVersionTable` report correct and relevant OS information, underlying .NET version, CPU architecture, OS display version on Windows · Issue #19121 · PowerShell/PowerShell
X Title: Make `$PSVersionTable` report correct and relevant OS information, underlying .NET version, CPU architecture, OS display version on Windows · Issue #19121 · PowerShell/PowerShell
Description: Summary of the new feature / enhancement While $PSVersionTable.PSVersion is frequently used programmatically, the remaining properties are typically relevant to the human observer, and, notably, $PSVersionTable output is requested when s...
Open Graph Description: Summary of the new feature / enhancement While $PSVersionTable.PSVersion is frequently used programmatically, the remaining properties are typically relevant to the human observer, and, notably, $P...
X Description: Summary of the new feature / enhancement While $PSVersionTable.PSVersion is frequently used programmatically, the remaining properties are typically relevant to the human observer, and, notably, $P...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/19121
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make `$PSVersionTable` report correct and relevant OS information, underlying .NET version, CPU architecture, OS display version on Windows","articleBody":"### Summary of the new feature / enhancement\n\nWhile `$PSVersionTable.PSVersion` is frequently used _programmatically_, the \nremaining properties are typically relevant to the human observer, and, notably, `$PSVersionTable` output is requested when submitting bug reports in this repo.\n\nThat output is currently suboptimal in several respects:\n\n* On Unix-like platforms, it doesn't provide a friendly OS name.\n * On macOS, you'll see something like:\n * `Darwin 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000`,\n * which neither tells you that this is a _Ventura_ release, nor its version (`13.1`)\n * On WSL, it isn't even obvious that you're running inside WSL; e.g.\n * `Linux 4.4.0-22621-Microsoft #1105-Microsoft Fri Jan 01 08:00:00 PST 2016`\n * I presume that other distros also do _not_ report their name (such as _Ubuntu_).\n\n* On Windows:\n * The friendly OS name is _obsolete_, because it comes from an API that is frozen for backward-compatibility; e.g., `Microsoft Windows 10.0.22621` is still reported on Windows 11(!)\n * It is missing the so-called display version, e.g. `22H2`, which is an important and easy way to identify the specific version.\n\n* _Update_: As @iSazonov points out, the machine architecture (x64, ARM32, ...) is important too and, on Windows, where 32-bit editions are still supported, whether the process is 32-bit.\n\n* Sometimes it is important to know what specific .NET version the given PowerShell version is built on - this information is missing (_Windows PowerShell_ has a `CLRVersion` property, which looks to be frozen in time as well).\n\n\n### Proposed technical implementation details (optional)\n\nThe exact format will have to be worked out, as well as whether to add the information to existing properties or whether to introduce new ones, but here are pointers as to where the information can be obtained (at least as an initial pointer - using system APIs is obviously preferable to calling CLIs):\n\n* Framework version:\n * `[System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription`\n\n* Windows\n * `Get-CimInstance Win32_OperatingSystem | Select-Object Caption, @{ n='DisplayVersion'; e={ Get-ItemPropertyValue 'HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion' DisplayVersion } }`\n\n* macOS:\n * `sw_vers`\n\n* Linux:\n * Ubuntu, Debian:\n * `lsb_release -a`\n * Others? Potential pointers here: https://www.cyberciti.biz/faq/find-linux-distribution-name-version-number/\n\n`uname -m` can provide machine architecture information on all Unix-like platforms.\n\nDesired sample output on Windows (doesn't try to maintain backward compatibility):\n\n```powershell\n# WISHFUL THINKING\nPS> $PSVersionTable\nName Value\n---- -----\nPSVersion 7.4.0-preview.1\nPSEdition Core\nGitCommitId 7.4.0-preview.1\nFrameworkVersion .NET 7.0.1 # \u003c- NEW\nOS Microsoft Windows 11 Pro 22H2 (x64/32) # \u003c- CHANGE\nPlatform Win32NT\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\nPSRemotingProtocolVersion 2.3\nSerializationVersion 1.1.0.1\nWSManStackVersion 3.0\n\n```\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2023-02-08T19:17:35Z","url":"https://github.com/PowerShell/PowerShell/issues/19121"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:39d511fe-a216-a221-aed3-70e58a93b5fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A63A:64532:7C7EA1:AC96DF:6AFD2D5C |
| html-safe-nonce | 9ad23859d1c8fcb5779942e295d73de9c803e78080c0fad4e38f79ed106a4a13 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjNBOjY0NTMyOjdDN0VBMTpBQzk2REY6NkFGRDJENUMiLCJ2aXNpdG9yX2lkIjoiNDUxNjIxNTI2MjM3MzgxNzY5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b162a3de8b0ba6c23fe7dd50482b9a3ed8f955990d2e6cd187cdd4d7804c3d1a |
| hovercard-subject-tag | issue:1576665470 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/19121/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b708e594edddee7aa8e921b0685a81b5c497affd9dab5b4d4ec0b4660f18d6a5/PowerShell/PowerShell/issues/19121 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b708e594edddee7aa8e921b0685a81b5c497affd9dab5b4d4ec0b4660f18d6a5/PowerShell/PowerShell/issues/19121 |
| og:image:alt | Summary of the new feature / enhancement While $PSVersionTable.PSVersion is frequently used programmatically, the remaining properties are typically relevant to the human observer, and, notably, $P... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 941021edf0c2ec58298f4a2c8f27ae507d129c92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width