posted

3 Comments

The new PowerCLI 4.1.1 has improved compatibility with scripts written for PowerCLI 4.0.1 and earlier.

PowerCLI 4.1 moved cmdlet output types to new namespaces. This introduced incompatibility with scripts which depend on output types’ full namespace path. To negate the impact of the change and to enable a transition period in which scripts can use full references to both old and new namespaces, PowerCLI 4.1.1 includes additional set of types which reside in the old namespaces (“the old types”) and are implemented by types in the new namespaces.

In practice, this means that code like:
function BackupVM ([VMware.VimAutomation.Types.VirtualMachine] $myVM) { … }
and
function BackupVM ([VMware.VimAutomation.Client20.VirtualMachineImpl] $myVM) { … }
works with PowerCLI 4.1.1 even though the correct (new) types are:
function BackupVM ([VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine] $myVM) { … }
and
function BackupVM ([VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl] $myVM) { … }

IMPORTANT: The described compatibility support is temporary. We plan to remove the old types in the release following 4.1.1. This means that no new scripts should be written based on the old types and legacy scripts should be updated to remove dependencies on the old types.

As always, it is advisable to avoid full namespace references where possible, and to reference types in the *.Types assemblies instead of their *.Impl counterparts.

Andrey Anastasov,
PowerCLI architect