< Back

Step-ModuleVersion

Sun Jan 12, 2020 6:53 pm

NAME Step-ModuleVersion



SYNOPSIS

Increments the ModuleVersion property in a PowerShell Module Manfiest





SYNTAX

Step-ModuleVersion [[-Path] <String[]>] [[-By] <String>] [<CommonParameters>]





DESCRIPTION

Reads an existing Module Manifest file and increments the ModuleVersion property.





PARAMETERS

-Path <String[]>

Specifies a path a valid Module Manifest file.



Required? false

Position? 1

Default value (Get-Item $PWD\\*.psd1)[0]

Accept pipeline input? true (ByValue, ByPropertyName)

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



NOTES





This function should only read the module and call Update-ModuleManifest with

the new Version, but there appears to be a bug in Update-ModuleManifest dealing

with Object[] types so this function manually de-serializes the manifest and

calls New-ModuleManifest to overwrite the manifest at Path.



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



C:\\PS>Step-ModuleVersion -Path .\\testmanifest.psd1



Will increment the Build section of the ModuleVersion









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



C:\\PS>Step-ModuleVersion -Path .\\testmanifest.psd1 -By Minor



Will increment the Minor section of the ModuleVersion and set the Build section to 0.









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



C:\\PS>Set-Location C:\\source\\testmanifest



C:\\PS> Step-ModuleVersion



Will increment the Build section of the ModuleVersion of the manifest in the current

working directory.











RELATED LINKS

http://semver.org/

New-ModuleManifest