Question:
Since PowerShell version 3 there has been very well defined comment based help comment block:
https://technet.microsoft.com/en-us/library/hh847834.aspx
What I would like to know is there a standard for versioning a PowerShell script like there is in C#? I am asking as I am about to publish a module and the psd1 file has:
1 2 3 |
# Version number of this module. ModuleVersion = '1.0.0.0' |
In my own scripts I use the following standard:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<# .SYNOPSIS .DESCRIPTION .EXAMPLE Example.ps1 Runs with default parameters .NOTES Author : Glen Buktenica Version : 1.0.0.0 20160725 Initial Build #> |
Answer:
Use the ScriptFileInfo
cmdlets, like: New-ScriptFileInfo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<#PSScriptInfo .VERSION 1.0.1 .GUID 54688e75-298c-4d4b-a2d0-1234567890ab .AUTHOR iRon .DESCRIPTION Your description .COMPANYNAME .COPYRIGHT .TAGS PowerShell Version .LICENSEURI https://github.com/LICENSE .PROJECTURI https://github.com/ .ICONURI https://Icon.png .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES .PRIVATEDATA #> |