This function was introduced in version 0.1.0.
Parse the specified version and create a fix version when needed.
Syntax
Get-FixVersion `
-Version <String> `
[-OnlyFixBelowVersion <String>] `
[-AppendRevisionLength <Int32>] `
[-NuspecFile <String>]
Description
When a 4-part version number is used by the software authors, there may be a little hard at times to push out an updated version by manually creating the fix version. This script helps out with this when both a 4-part version is used, and when a prerelease have been passed.
Notes
While the parameter NuspecFile
accepts globbing patterns,
it is expected to only match a single file.
Aliases
None
Examples
Example 1
Get-FixVersion -Version '24.0.0.195'
will output 24.0.0.19501
if the
nuspec version is equal to 24.0.0.195
or 24.0.0.19500
and
$global:au_Force
is set to $true
Example 2
Get-FixVersion -Version '5.0-beta'
will output 5.0-beta-20171123
(the current date)
Inputs
None
Outputs
Will output the full version number with a fix number when a 4-part version have been specified.
Will append the date to any pre-release versions.
Will just return the same version number if no fix is needed, or when the version number isn't a 4-part version.
Required Parameters
-Version <String>
The version number to parse for a fix version
Property | Value |
---|---|
Aliases | |
Position? | 1 |
Globbing? | false |
Default Value | |
Accept Pipeline Input? | false |
Optional Parameters
-OnlyFixBelowVersion <String>
The version to stop adding fix versions to (in case of padding revision number)
Property | Value |
---|---|
Aliases | |
Position? | 2 |
Globbing? | false |
Default Value | |
Accept Pipeline Input? | false |
-AppendRevisionLength <Int32>
The number of zeros to append the revision number with, before adding the fix number (defaults to 1).
Property | Value |
---|---|
Aliases | |
Position? | 3 |
Globbing? | false |
Default Value | 1 |
Accept Pipeline Input? | false |
-NuspecFile <String>
The nuspec metadata file to parse for the existing version information (defaults to '.*.nuspec')
Property | Value |
---|---|
Aliases | |
Position? | 4 |
Globbing? | true |
Default Value | ./*.nuspec |
Accept Pipeline Input? | false |