I have two datacenters and am running PowerCLI 11.2.0 and vSphere 6.7u1.
When I try moving a VM to a different folder in the same datacenter, this happens:
try {
Move-VM -VM $vm -InventoryLocation $folder -ErrorAction Stop
} catch {
$_
$_.Exception.ExpectedDatacenter
$_.Exception.InvalidArgumentInternal
}
Move-VM : 4/2/2019 8:10:28 AM Move-VM The operation for the entity "test-vm"
failed with the following message: "The input arguments had entities that did not
belong to the same datacenter."
At line:2 char:5
+ Move-VM -VM (Get-VM "test-vm") `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Move-VM], DatacenterMismatch
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates
_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.MoveVM
Datacenter-datacenter-34666
Entity InputDatacenter LinkedView
------ --------------- ----------
HostSystem-host-145951 Datacenter-datacenter-2
Folder-group-v49412 Datacenter-datacenter-2
ResourcePool-resgroup-436820 Datacenter-datacenter-2