PowerCLI 6.0 and vCheck, Vds Module

In PowerCLI 6.x, VMware began transitioning to Modules rather than PowerShell Snapins.  Read more about it here:

Chris Wahl wrote an excellent article about the PowerCLI changes, particularly how they affect VMware.VimAutomation.Vds:

Using this information, I submitted a pull request to the vCheck GitHub repository for two network plugins that use the VMware.VimAutomation.Vds cmdlets, with my changes to support the PowerCLI 6.x approach:

My goal was to preserve the original code as much as possible, while also adding support for loading the necessary cmdlets via modules.  Therefore I took two different tactics, following the method each original author used to check for the Vds cmdlets in their plugin.

Here’s a relevant snippet, in this case I am checking the build number to see if it is newer than PowerCLI 6.0 Release 1, and if so use Get-Module and Import-Module rather than Add-PSSnapin:

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *