-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Here are some examples of invalid semantic versioning version numbers that are not valid by semver.org suggested regex:
## Should work
[semver]'1'
[semver]'1.0.0'
[semver]'1.0.0-beta'
[semver]'1.0.0-beta1'
[semver]'1.0.0-beta.1'
## Should error but doesn't
[semver]'1.0.0-beta..1'
[semver]'1.0.0-beta...1'
## Should error and does
[semver]'1.0.0-beta!1'This tells me [semver] isn't fully compliant with semantic versioning v2.0.0.
Additional search tags:
SemanticVersion,[SemanticVersion]System.Management.Automation.SemanticVersion,[System.Management.Automation.SemanticVersion]
Expected behavior
Follow semver specification. Throw an error on non-valid version numbers. Like with [semver]'1.0.0-beta!1' which gives:
InvalidArgument: Cannot convert value "1.0.0-beta!1" to type "System.Management.Automation.SemanticVersion". Error: "The input string '' was not in a correct format."Actual behavior
PS > [semver]'1.0.0-beta...1'
Major Minor Patch PreReleaseLabel BuildLabel
----- ----- ----- --------------- ----------
1 0 0 beta...1
PS >Error details
No response
Environment data
- PowerShell v7.4.1 x64
- Windows 11 23H2 x64
Visuals
No response
Metadata
Metadata
Assignees
Labels
No labels