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     2.4.0.44   ISESteroids                         {Add-SteroidsContextMenuCommand, Add-SteroidsEditorTabComm...
Binary     2.3.0.64   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                     2.4.0.44   ISESteroids
Cmdlet          Add-SteroidsEditorTabCommand                       2.4.0.44   ISESteroids
Cmdlet          Add-SteroidsLicense                                2.4.0.44   ISESteroids
Cmdlet          Add-SteroidsTextChange                             2.4.0.44   ISESteroids
Cmdlet          Add-SteroidsTool                                   2.4.0.44   ISESteroids

Thanks,

Michael

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 https://github.com/juneb/AvoidVersionChaos

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