2

Can anyone tell me what the recommended practice is for PowerShell Module GUID's. Initially a new Module gets labeled with a GUID. When I later come back to update/extend/change the module, I increment the ModuleVersion value, but should the GUID value also be changed?

Porky
  • 890
  • 6
  • 6
  • 5
    The [`GUID` (Globally unique identifier)](https://nl.wikipedia.org/wiki/Globally_unique_identifier) should stay the same. If you e.g. upload your script to the [PowerShell Gallery](https://www.powershellgallery.com/), it identify it as the same script/module and append the new version to the Version History. – iRon Aug 10 '18 at 11:26

2 Answers2

3

The GUID identifies the module, not the version. Hence the GUID should not be changed.

vrdse
  • 2,899
  • 10
  • 20
0

The module Guid is defined in your module's psd1.

And you and get other module's Guid by runing (Get-Module -Name [moduleName]).Guid

Enpeng
  • 33
  • 3