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
{{ message }}
Repository navigation
Feature: Support SemVer 2.0 Informational Version #110
and also puts the whole thing into the release notes.
We love that, but are trying to adopt GitVersion and the SemVer 2.0 version numbers for everything else.
Unfortunately, although PowerShell is ok with that, PowerShellGet is not: you can't publish the module:
The Prerelease string 'PullRequest17887.2' contains invalid characters.
Please ensure that only characters 'a-zA-Z0-9' and possibly hyphen ('-') at the beginning are in the Prerelease string.
Note that hyphens aren't really allowed -- they're just willing to ignore ONE at the beginning of the string.
Could you take any valid SemVer 2 version number, like say 1.2.3-beta.4 or 1.2.3-pre-release.2+build24 and:
strip the non-alphanumeric digits that PowerShellGet won't accept
zero-pad the number at the end (maybe default to 4 digits?)
Note: there's also a length limit to pre-release strings in nuget 2 -- or is that in PSGet/PowerShell Gallery? Actually, it doesn't matter. The point is that we might need this to be truncated to work, and I'm not sure what I think should happen in that case.
Activity
Jaykul commentedon Nov 22, 2021
Note: there's also a length limit to pre-release strings in nuget 2 -- or is that in PSGet/PowerShell Gallery? Actually, it doesn't matter. The point is that we might need this to be truncated to work, and I'm not sure what I think should happen in that case.
#110 Support SemVer 2.0 by converting the prerelease
Jaykul commentedon May 9, 2026
This is implemented in 3.2 -- but you have to pass how many digits you want to pad the pre-release number to.
For instance:
Build-Module -Verbose -Debug -SemVer 1.2.3-beta.4 -ZeroPadLegacy 2Will result in 1.2.3 beta_04