How To Install VMware PowerCLI via PowerShell
The installation is done completely through PowerShell itself using the PowerShell Gallery via PowerShellGet. To install the PowerCLI 11, you just need to open the PowerShell with administrative privilege and type the following command to run the installation.
Install-Module -Name VMware.PowerCLI -RequiredVersion 18.104.22.16889667 -Scope AllUsers
PowerCLI will automatically be installed for all users. If you want to limit the installation to a specific user, change the Scope parameter to “CurrentUser”. You will be asked to trust the PSGallery modules, as PowerCLI is one of them.
If you are running a self-signed certificate for vCenter Server, you need to run the following PowerCLI Configuration command before connecting to any vCenter server:
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
It is done and now you can connect to a VMware vCenter or ESXi host. To connect vCenter use Connect-VIServer command.
Connect-VIServer vcsa.vmware.local -user firstname.lastname@example.org -pass VMware123
Or you can just type the following command and a pop up will be opened and you enter your credentials.
As you will see the connection is established successfully and you can utilize hundreds of command to manage you virtual infrastructure.