I've just updated from Powershell 4 and PowerCLI 4.* to Powershell 5 and PowerCLI 6.*. After updating, adding/using snapin VMWare.VimAutomation.Core
isn't working:
PS C:\Users\Me> Add-PSSnapin VMWare.VimAutomation.Core
Add-PSSnapin : Unexpected error: A connection core service provider is already registered. Cannot register new one.
When trying to remove:
PS C:\Users\Me> Remove-PSSnapin VMWare.VimAutomation.Core
Remove-PSSnapin : No Windows PowerShell snap-ins matching the pattern 'VMWare.VimAutomation.Core' were found.
Check the pattern and then try the command again.
From Get-PSSnapin -Registered
, I get:
Name : VMware.VimAutomation.Core
PSVersion : 4.0
Description : This Windows PowerShell snap-in contains Windows PowerShell cmdlets for managing vSphere.
I uninstalled and reinstalled PowerCLI 6.3 and all was fixed. Get-PSSnapin -Registered
now returns the following:
Name : VMware.VimAutomation.Core
PSVersion : 5.0
Description : This Windows PowerShell snap-in contains Windows PowerShell cmdlets for managing vSphere.
Also to note: VMware.VimAutomation.Core is both a module and a snapin in this version of PowerCLI.