You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 compared to each other (the only useful assertion possible is that the PSVersion is -lt "6.0.0")
You 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
Note that both the tests below return TRUE if $SemVer is Nuget.SemanticVersion:
>$PSVersionTable
Name Value
---------
PSVersion 6.0.0-beta
PSEdition Core
GitCommitId v6.0.0-beta.7
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Reacted by Mark Kraus, Flavien MICHALECZEK and Keith Hill
Activity
iSazonov commentedon Oct 5, 2017
Dongbo Wang (@daxian-dbw) We discussed
PSVersionTable.PSVersionin previous PR - could you please comment the Issue?iSazonov commentedon Oct 5, 2017
Fix for compare is ready.