Installing PowershellGet on Windows 7

Recently, I had to re-install OS on my primary workstation at home.  And of course, I had to get PowerShellGet  working again before I could install PowerCLI, or vDocumentation modules. Naturally, it took some time to hunt down the bits and pieces on getting PowerShellGet up and running. So, this time around I have decided to document getting PowerShellGet working on Windows 7, as well as making sure that I am using the latest version of it.
Windows 7 Pro/ENT  by default comes with PowerShell v2, and doesn’t contain PowerShellGet.

All the commands are run with elevated (a.k.a administrator’s) privileges under x64 bit Powershell console.

let’s start the PowerShell console  and see currently available modules:

 

get-module listavailable

Let’s find out the current version installed:

psversion

 

Time to install the Windows Management framework 5.1 

PowerShellGet requires Powershell 5.0 or above. So, lets get the latest  WMF which is v5.1. It is available at Microsoft’s website in both x86 and x64 version for Windows 7.

Windows Management framework 5

Make sure to download the .zip file. An extracted zip archive contains 2 files; a “Install-WMF5.1.ps1″ PowerShell script, and a “Win7AndW2K8R2-KB3191566-x64.msu” msu file.  You will need to start a PowerShell console with elevated privileges, and then run the “Install-WMF5.1.ps1” script.

Here is the tricky part, you need to adjust the Execution Policy and code signing permissions a bit before the script could be executed.

 

Afterwards, you will need to open the Powershell console and cd into the to the folder you have extracted the files to, and then run the ps1 script:

 

Once the script executed it will ask your permission to run it. You could either  do R ( run once) or A ( always run)

A Windows Installer will pop-up asking your permission to install the KB3191566 software update, given that all the steps are done properly.

 

You will need to reboot the PC once the KB3191566  has finished installing.  Now lets check the Powershell version, and list available modules once again.

 

 

 

Now we have PowerShellGet and PackageManagement  available to us, albeit they are both version 1.0.0.1.

Next blog we will upgrade both to the latest version, as well as install the PowerCLI.

 

Links to Resources used:
https://www.microsoft.com/en-us/download/details.aspx?id=54616 
https://stackoverflow.com/questions/1825585/determine-installed-powershell-version
https://www.darkoperator.com/blog/2013/3/5/powershell-basics-execution-policy-part-1.html
https://www.powershellgallery.com/packages/PowerShellGet/1.6.0
https://www.powershellgallery.com/packages/vDocumentation/2.3.0

 

Please follow and like us:

One Reply to “Installing PowershellGet on Windows 7”

Leave a Reply

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