liveBook · Manning

Version

As explained in Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools

A script version is a release identifier recorded in a script's metadata to distinguish one published revision from another.

A version is a release identifier recorded in module metadata or a script file header. It distinguishes published revisions so users can obtain or recognize an updated release. section 16.3.1 section 22.6.4

Use versions to make publishing changes visible and manageable:

  • Set ModuleVersion in a manifest generated with New-ModuleManifest; use standard W.X.Y.Z notation, such as 1.0.0. section 16.3.1 section 22.4.2
  • Increment the version whenever you improve a module or fix bugs, allowing users to retrieve the newest release with Update-Module. section 22.5.1
  • Change a published script's file-info header before running Publish-Script again. section 22.6.4
  • Treat published versions as lasting records: hide an obsolete version from search results rather than deleting it. section 22.5.1 section 22.6.4

A small release change

A module initially declares ModuleVersion = '1.0.0'. After a bug fix, update the manifest to a new version before republishing; users can then use Update-Module to obtain the latest release. section 22.4.2 section 22.5.1

How Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools covers it

How deep it goes
Explains where to record versions, when to increment them, and how to hide prior releases, without detailing a complete release policy.
Examples
Uses 1.0.0, manifest ModuleVersion, script file-info headers, republishing, and hiding versions from gallery search results.
What it assumes
Assumes familiarity with PowerShell modules or scripts, manifests, and publishing commands such as Publish-Script.
What you can do after
Operate publishing workflows by updating metadata, republishing revisions, retrieving releases, and hiding obsolete versions.
How it connects
Connects versions with module manifests, semantic versioning, PowerShell Gallery, Update-Module, Publish-Script, and version history.

Also explained in

Compare how 5 books explain version →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools. The section links point to the parts of the book it draws on.