Upgrading PowershellGet to the latest version

This is a part 2 of the getting Powershell upgraded from v2 to v5.1, and PowerShellGet and PowerCLI installed and running on a Windows 7 Pro/Ent workstation.

The latest PowerShellGet version as of today, January 2018, in the PSGallery is v1.6.0. It needs to be downloaded to local repository first before installing it.

   PS C:\> mkdir PSRepo
   PS C:\> Save-Module -Name PowershellGet -Path C:\PSRepo

Something to note here, NuGet package is required before continuing further, and it will be installed automatically when PowerShellGet is upgraded or downloaded.

  PS C:\> install-module -name PowershellGet -force

Let’s list the Powershell modules again, and confirm that PowerShellGet 1.6.0 is available to us.

  PS C:\> Get-Module -ListAvailable

PowershellGet 1.6 installed with old version

Oops, we have got the older versions of PackageManagement and PowershellGet still there. Naturally, we need to remove the older versions at this point.
Close the Powershell Console, if you still have it open.

  1. Browse to C:\Program Files\WindowsPowerShell\Modules\
  2. Go into C:\Program Files\WindowsPowerShell\Modules\PowershellGet folder, and delete the sub- folder
  3. Then do the same for C:\Program Files\WindowsPowerShell\Modules\PackageManagement, delete the sub-folder


Open the Powershell Console, and list the modules again:

 PS C:\> Get-Module -ListAvailable

Get-Module -ListAvailable

We do not have older versions of the PowerShellGet and PackageMananement listed anymore !!!

Now that its out of the way, let’s get us some modules from PowerShellGallery.

The following is one of the ways to get necessary modules installed and running:

  1. Look up a module and its version  using the following command:  Find-Module -Name PartialName*
  2. Download it to a local repository using  Save-Module -Name ModuleName -Path DriveLetter:\RepoLocation
  3. Install the module via  Install-Module -Name ModuleName -Force
      1. You could use the “-MinimumVersion xxx.x.x ” if you looking to force install the latest version, with xxx.x.x being version number


    PS C:\> find-module -name sqlserver
    PS C:\> save-module -name sqlserver -path c:\PSRepo
    PS C:\> install-module -name sqlserver


Next Post will be about installing PowerCLI from PowershellGallery on Windows 7