Installing PowerCLI from PowershellGallery

This is   part 3 of Installing PowershellGet on Windows 7. This time we are going to install PowerCLI latest version from the PowerShell Gallery.

Part 2:  http://shaulov.us/2018/01/13/upgrading-powershellget-1-0-0-1-to-the-latest-version
Part 1:  http://shaulov.us/2018/01/09/installing-powershellget-windows-7/

Let’s head to PowershellGallery website, and  find the latest stable version for PowerCLI https://www.powershellgallery.com. As of today, version “7736736” is still in beta. So we are going to use “-RequiredVersion” option to download and install the previous, stable, release.

Open the Powershell with elevated ( Administrator level) privileges:

PS C:\> Save-Module -Name VMware.PowerCLI -Path c:\PSRepo -RequiredVersion 6.5.4.7155375

PS C:\> install-module -name VMware.PowerCLI

Note:  you might need to press “A” to allow install to proceed, as PSGallery might not be in your trusted list of repositories  to download and install modules from:

Ideally, you should now be able to run  any PowerCLI  cmdlet and it would work as expected.

Note: You must uninstall older ( non-PovershellGallery one) versions of the PowerCLI manually from Programs and Features, and then re-install VMware.PowerCLI via PowershellGet,  otherwise they will conflict with the new version, and it will only work partially.

Please, see a nice write-up below in case if the VMware.PowerCLI don not load automatically.

http://www.gsx.com/blog/bid/81096/enhance-your-powershell-experience-by-automatically-loading-scripts