< Back

Get-SemVerFromString

Mon Jan 13, 2020 1:33 am

NAME Get-SemVerFromString



SYNOPSIS

Private function to parse a string to a SemVer 2.0 custom object, but with added Revision number common to .Net

world (and Choco Packages)





SYNTAX

Get-SemVerFromString [[-VersionString] <String>] [<CommonParameters>]





DESCRIPTION

This function parses the string of a version into an object composed of a [System.Version] object (Major, Minor,

Patch, Revision)

plus the pre-release identifiers and Build Metadata. The PreRelease metadata is also made available as an array to

ease the

version comparison.





PARAMETERS

-VersionString <String>

String representation of the Version to Parse.



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Management.Automation.PSObject





NOTES





The function returns a PSObject of PSTypeName Package.Version



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-SemVerFromString -VersionString '1.6.24.256-rc1+01012018'













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-SemVerFromString -VersionString '1.6-alpha.13.24.15'















RELATED LINKS