Upgrading PowershellGet 1.0.0.1 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.

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

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

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 1.0.0.1
  3. Then do the same for C:\Program Files\WindowsPowerShell\Modules\PackageManagement, delete the sub-folder 1.0.0.1

 

Open the Powershell Console, and list the modules again:

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

    Example:

    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

 

 

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *