Skip to content

Complete the SemanticVersion work  #2983

@HemantMahawar

Description

@HemantMahawar
  • Support SemVer in #Requires (PowerShell version (-Version) as well as module version (-Modules))
  • Allows cmdlet parameters to consume SemVer instead of System.Version (argument transformation maybe?)
    • Users can convert Semver to System.Version using that attribute before passing to the cmdlet parameter
    • Cmdlet author can mark the attribute on the parameter and users can pass Semver string

=======================
User Experience:

  • On disk, module versions presents - 1.0.0, 1.0.0-alpha17, 1.0.1

  • Result:

    Command Expected Output Comments
    Import-Module -Version 1.0.2 Error Version is alias to min version
    Import-Module -MinimumVersion 1.0.0 Module with version 1.0.1 should be loaded
    Import-Module -Version 1.0.0-alpha15 Module with version 1.0.1 should be loaded
    Import-Module -Name Module with version 1.0.1 should be loaded Latest version of module should be loaded
    Import-Module -RequiredVersion 1.0.0 Module with version 1.0.0 should be loaded

Note that 1.0.0 is higher than 1.0.0-alpha17, so if 1.0.1 doesn't exist, then Import-Module would load 1.0.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Blockedblocked on something external to this repoIssue-Enhancementthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeWG-Enginecore PowerShell engine, interpreter, and runtimeWG-TriagedThe issue has been triaged by the designated WG.Waiting - DotNetCorewaiting on a fix/change in .NET

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions