I use get-datacenter to get VM tools infomation in my vSphere environment.
But it's failed,Why?
Your command is correct.
Maybe there is something weird in the VM that is trying to query...
Let's try:
Execute Get-VM and check if it throws the same exception and underlining the Commandlet.
If it continues appearing the same exception I would:
1. Try in another workstation with PowerCLI and see if works.
2. Uninstall/Install PowerCLI on the affected workstation.
I use PowerPLI connection to another vCenter, the same command, it's OK.
And with that vCenter it throws the exception?
Seems weird...it seems more a problem when querying a particular VM...
Could you try again, but only with the Get-VM?
Yes, only the vCenter Server has the issue.
I new create a VM, it is OK.
but old VMs, it's failed
Are the vCenter versions different? On what version of vCenter is the affected one?
vCenter 6.7 is failed
vCenter 6.5 is OK
Is the VM Version updated also? It might be because of the VM version.
It's two environment.
VM version is latest