Title: SMA SemanticVersion not SemVer 2 compliant · Issue #5004 · PowerShell/PowerShell · GitHub
Open Graph Title: SMA SemanticVersion not SemVer 2 compliant · Issue #5004 · PowerShell/PowerShell
X Title: SMA SemanticVersion not SemVer 2 compliant · Issue #5004 · PowerShell/PowerShell
Description: First: System.Management.Automation.SemanticVersion is not SemVer v2 compliant Second: PowerShell releases are using SemVer v2 syntax Therefore: $PSVersionTable.PSVersion is truncated and thus broken, as pre-release versions cannot be co...
Open Graph Description: First: System.Management.Automation.SemanticVersion is not SemVer v2 compliant Second: PowerShell releases are using SemVer v2 syntax Therefore: $PSVersionTable.PSVersion is truncated and thus brok...
X Description: First: System.Management.Automation.SemanticVersion is not SemVer v2 compliant Second: PowerShell releases are using SemVer v2 syntax Therefore: $PSVersionTable.PSVersion is truncated and thus brok...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5004
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SMA SemanticVersion not SemVer 2 compliant","articleBody":"\r\nFirst: System.Management.Automation.SemanticVersion is not SemVer v2 compliant\r\n\r\nSecond: PowerShell releases are using SemVer v2 syntax\r\n\r\nTherefore: `$PSVersionTable.PSVersion` is truncated and thus *broken*, as pre-release versions cannot be compared to each other (the only useful assertion possible is that the PSVersion is `-lt \"6.0.0\"`)\r\n\r\nYou should be using (an implementation like) Nuget.Core's Nuget.SemanticVersion which handles `-prerelease` and `+patch` as well as dotted versions like your `6.0.0-beta.7`\r\n\r\nNote that both the tests below return TRUE if $SemVer is Nuget.SemanticVersion:\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n$SemVer = [System.Management.Automation.SemanticVersion]\r\n(\"6.0.0-beta.10\" -as $SemVer) -gt (\"6.0.0-beta.7\" -as $SemVer)\r\n(\"6.0.0+fixes\" -as $SemVer) -gt (\"6.0.0-beta\" -as $SemVer)\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\nTrue\r\nTrue\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\nFalse\r\nFalse\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- provide the output of $PSVersionTable --\u003e\r\n\r\n```powershell\r\n\u003e $PSVersionTable\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-beta\r\nPSEdition Core\r\nGitCommitId v6.0.0-beta.7\r\nOS Microsoft Windows 10.0.15063\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/Jaykul","@type":"Person","name":"Jaykul"},"datePublished":"2017-10-04T19:07:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/5004/PowerShell/issues/5004"}
| 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:9171ca5e-0c93-d62f-3d33-f2e48e7d1a5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B846:2ACA74:5A8B580:7F12A62:6A572453 |
| html-safe-nonce | d8add7f4087aa238f7c4228eda2a009c281edda6de4350a1dd089f9ac58e16ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODQ2OjJBQ0E3NDo1QThCNTgwOjdGMTJBNjI6NkE1NzI0NTMiLCJ2aXNpdG9yX2lkIjoiNDUyMjA4OTk2NTg3NTA0NTQ2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7f36daa2fbc2c20f42f82a42306d7742913b7f82c7f6e67b376c6d8ef4eab441 |
| hovercard-subject-tag | issue:262897368 |
| 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/5004/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f9befaca700b618196f5b65dbbdae82ec4b1d420db4caadb800c91561fd58b76/PowerShell/PowerShell/issues/5004 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f9befaca700b618196f5b65dbbdae82ec4b1d420db4caadb800c91561fd58b76/PowerShell/PowerShell/issues/5004 |
| og:image:alt | First: System.Management.Automation.SemanticVersion is not SemVer v2 compliant Second: PowerShell releases are using SemVer v2 syntax Therefore: $PSVersionTable.PSVersion is truncated and thus brok... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jaykul |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width