I think I've tried just about everything, followed the various forum posts here on resolving this issue but I cannot get PowerCLI to work! I can't believe how difficult this is. I followed instructions on installing and uninstalling but no success. I'm trying this on 3 different Windows 10 systems without success (Windows 10 Enterprise, versions 1709 and 1809). The main issue i'm trying to resolve is:
PS C:\WINDOWS\system32> Install-Module -Name VMware.PowerCLI -Confirm:$false -AllowClobber -Force
PS C:\WINDOWS\system32> Connect-VIServer
Connect-VIServer : The 'Connect-VIServer' command was found in the module 'VMware.VimAutomation.Core', but the module
could not be loaded.For more information, run 'Import-Module VMware.VimAutomation.Core'.
At line:1 char:1
+ Connect-VIServer
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-VIServer:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
PS C:\WINDOWS\system32> [System.Environment]::OSVersion.Version
Major Minor Build Revision
----- ----- ----- --------
10 0 16299 0
PS C:\WINDOWS\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.785
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.785
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> $env:PSModulePath.Split(';')
C:\Users\pc2550\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> Get-Module -Name VMware* -ListAvailable | Select Name,Version,ModuleBase
Name Version ModuleBase
---- ------- ----------
VMware.DeployAutomation 6.7.0.11233116 C:\Program Files\WindowsPowerShell\Modules\VMware.DeployAutomati...
VMware.ImageBuilder 6.7.0.11233116 C:\Program Files\WindowsPowerShell\Modules\VMware.ImageBuilder\6...
VMware.PowerCLI 11.1.0.11289667 C:\Program Files\WindowsPowerShell\Modules\VMware.PowerCLI\11.1....
VMware.Vim 6.7.0.10334489 C:\Program Files\WindowsPowerShell\Modules\VMware.Vim\6.7.0.1033...
VMware.VimAutomation.Cis.Core 11.0.0.10335701 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Cloud 11.0.0.10379994 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Common 11.0.0.10334497 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Core 11.0.0.10336080 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.HorizonView 7.6.0.10230451 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.License 10.0.0.7893904 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Nsxt 11.0.0.10364044 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Sdk 11.0.0.10334495 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Security 11.0.0.10380515 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Srm 11.1.0.11289292 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Storage 11.1.0.11273342 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.StorageUtility 1.3.0.0 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Vds 11.0.0.10336077 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.Vmc 11.0.0.10336076 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VimAutomation.vROps 10.0.0.7893921 C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation....
VMware.VumAutomation 6.5.1.7862888 C:\Program Files\WindowsPowerShell\Modules\VMware.VumAutomation\...
PS C:\WINDOWS\system32> Get-WmiObject -Class Win32_Product -Filter "name like '%PowerCLI%'" | Select Name,Version
PS C:\WINDOWS\system32>
I verified that the files do exist in the module directories, and verified they're removed during an uninstall, using these commands:
(Get-Module VMware.PowerCLI -ListAvailable).RequiredModules | Uninstall-Module -Force
Get-Module VMware.PowerCLI -ListAvailable | Uninstall-Module -Force
I did this as admin, i tried an older version too. I would not expect this much difficulty from a basic Windows 10 installation where PowerCLI has never been installed.