Two weeks ago, VMware released PowerCLI 6.5.1 with big enhancements.
There is no longer need to download and install MSI file. You can now install PowerCLI directly from the PowerShell Gallery. The PowerShell Gallery is the central repository for PowerShell content from which you can find new PowerShell commands. Installing items from the Gallery requires the latest version of the PowerShellGet module which is available in Windows Management Framework (WMF) 5.0.
Another enhancement is that the modules have also been updated to support the PowerShell auto-loading process. It means that we no longer need to load the PowerCLI module into the PowerShell session. When you will use the first cmdlet then the PowerCLI module will be loaded as needed.
Prerequisites
- Windows Management Framework 5 or greater is installed
- Uninstall existing versions of PowerCLI
- Close all the PowerShell sessions
Online Installation
Install the PowerCLI module from PowerShell Gallery. Administrator rights might be required to install modules on your machine:
PS > Install-Module -Name VMware.PowerCLI NuGet provider is required to continue PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or 'C:\Users\Nicolas\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the NuGet provider now? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y Untrusted repository You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y
You may need to update the module:
PS > Find-Module "VMWare.*" | Update-Module -Verbose
Now, you just have to load the module:
PS > Import-Module VMware.PowerCLI
That’s it!
More information here
Offline Installation
If you have non-internet connected servers then you might need to install PowerCLI. Use the Save-Module cmdlet:
PS > Save-Module -Name VMware.PowerCLI -Path <path_to_your_shared_folder>
You could save to a USB drive or network drive or any other storage location.
Thanks for reading! You can follow me on Twitter @PrigentNico