how to get install-module in ps version 4

This topic contains 2 replies, has 3 voices, and was last updated by  postanote 3 weeks, 3 days ago.

  • Author
    Posts
  • #84746

    Narinder Verma
    Participant

    Hi,
    I am on powershell version 4 . How to install modules like cchoco in powershell version 4 .In version 5 we have install-module but m not able to find anything like that for version 4 .Updating powershell is not an option.

    PS > $PSVersionTable.PSVersion

    Major Minor Build Revision
    —– —– —– ——–
    4 0 -1 -1

    Thanks in advance.

  • #84764

    Richard Siddaway
    Moderator

    Install-Module was introduced with Powershell v5 if I remember correctly. It, and the other module/package management cmdlets aren't available in PowerShell v4.

    You'll need to upgrade at least one machine to PowerShell v5.1. You can download to that machine and copy out to other machines – assuming that the module you want will work with PowerShell v4

  • #84844

    postanote
    Participant

    No need to upgrade to PoSH v5 for this.
    You can get PowerShellGet, which is what provides this in PoSH v4. You just have to download and install it.

    'microsoft.com/en-us/download/details.aspx?id=51451'
    'blogs.msdn.microsoft.com/powershell/2016/09/29/powershellget-and-packagemanagement-in-powershell-gallery-and-github'

    I have it on all my PoSH v4 installs as a default.

    But, yep, if you can go to PoSH v5, it's best to do so.

You must be logged in to reply to this topic.