posted

4 Comments

In PowerCLI 4.1 we changed the namespaces in which output types live. This was done to improve the internal structure and enable other VMware teams to write cmdlets for the products they develop.

While the types remain the same (save for new features), the namespaces have changed and this affects scripts which use full namespace paths, for example:

if ($myObject -isnot VMware.VimAutomation.Client20.VirtualMachineImpl)

If you have scripts which quote full namespace paths, you need to replace the old namespace with the new one. A full listing of the changes is available in this file:
Download TypeMapping – PowerCLI 4.0.1 to 4.1

Here are few examples to give you an idea of what’s in the file:

VMware.VimAutomation.Types.VirtualMachine -> VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine
VMware.VimAutomation.Types.VMHost -> VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost
VMware.VimAutomation.Client20.VirtualMachineImpl -> VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl
VMware.VimAutomation.Client20.VMHostImpl -> VMware.VimAutomation.ViCore.Impl.V1.Inventory.VMHostImpl

You can always check for incompatible types with a simple script: