< Back

Step-Version

Sun Jan 12, 2020 6:54 pm

NAME Step-Version



SYNOPSIS

Increment a Semantic Version





SYNTAX

Step-Version [-Version] <Version> [[-By] <String>] [<CommonParameters>]





DESCRIPTION

Parse a string in the format of MAJOR.MINOR.PATCH and increment the

selected digit.





PARAMETERS

-Version <Version>

Version as string to increment



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-By <String>

Version section to step



Required? false

Position? 2

Default value Patch

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

String





OUTPUTS

String





NOTES





This function operates on strings.



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



C:\\PS>Step-Version 1.1.1



1.1.2



Will increment the Patch/Build section of the Version









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



C:\\PS>Step-Version 1.1.1 Minor



1.2.0



Will increment the Minor section of the Version









-------------------------- EXAMPLE 3 --------------------------



C:\\PS>Step-Version 1.1.1 Major



2.0.0



Will increment the Major section of the Version









-------------------------- EXAMPLE 4 --------------------------



C:\\PS>$v = [version]"1.1.1"



C:\\PS> $v | Step-Version -Type Minor

1.2.0











RELATED LINKS