SxS modules

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Michael Maher Michael Maher 7 months, 1 week ago.

  • Author
    Posts
  • #38378
    Profile photo of Michael Maher
    Michael Maher
    Participant

    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

  • #38384
    Profile photo of Jonathan Warnken
    Jonathan Warnken
    Participant

    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

  • #38388
    Profile photo of Michael Maher
    Michael Maher
    Participant

    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

You must be logged in to reply to this topic.