Author Posts

April 29, 2016 at 4:34 am

Hi Folks,

I've installed two versions of a module like below.

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Binary   ISESteroids                         {Add-SteroidsContextMenuCommand, Add-SteroidsEditorTabComm...
Binary   ISESteroids                         {Add-SteroidsContextMenuCommand, Add-SteroidsEditorTabComm...

Is it safe to assume the newest version of the Cmdlet will always run?

PS Library:\> gcm -Module isesteroids

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Add-SteroidsContextMenuCommand              ISESteroids
Cmdlet          Add-SteroidsEditorTabCommand                ISESteroids
Cmdlet          Add-SteroidsLicense                         ISESteroids
Cmdlet          Add-SteroidsTextChange                      ISESteroids
Cmdlet          Add-SteroidsTool                            ISESteroids



April 29, 2016 at 5:41 am

it is not safe to assume that the newest version will always run. June Blender has a great presentation covering version chaos. The powerpoint and scripts are in github

April 29, 2016 at 7:58 am

Thanks Jonathan, I was not at the conference but follow June on Twitter. I did flick through these when June put them up but forgot about them since.

I reviewed the slides again and like you said you get the first version of the module discovered that meets the specification.

So some of the suggestions . . .

* Use the -version parameter with Import-Module

* Remove-Module when no longer needed

* Use the module qualified name, for example: PSCX\Expand-Archive