Take advantage of Windows PowerShell 3.0 to manage your VMware environment

If you meet the system requirements for Windows Management Framework 3.0, then make sure you take advantage of Windows PowerShell 3.0 to manage your VMware environment. You will still use the same vSphere PowerCLI cmdlets that you’re used to, but run them from the Windows PowerShell Integrated Scripting Environment (ISE).

To achieve this, you need to know the name of the PowerCLI snap-in you want to add, and then add the snap-in to the current ISE session.

Step 1 : Get the vSphere PowerCLI snap-in name

Execute the following from the vSphere PowerCLI;

## Get Snap-in name that matches "VMware"
Get-PSSnapin | Where {$_.Name -match "VMware"} | Select Name

Depending on your version, you should see results similar to this;

PowerCLI-Get-PSSnapin

Step 2 : Add the snap-in to your current ISE session

Now that you know the names of the vSphere PowerCLI snap-ins, you can add them to your ISE session by running the following;

## Adds one or more Windows PowerShell snap-ins to the current session.
Add-PSSnapin VMware.VimAutomation.Core
Add-PSSnapin VMware.VimAutomation.License
Add-PSSnapin VMware.DeployAutomation
Add-PSSnapin VMware.ImageBuilder

## Retrieves the versions of the installed PowerCLI snapins.
Get-PowerCLIVersion

You should now see the versions of the snap-ins that were added;

PowerCLI-Get-PowerCLIVersion

You can start using the vSphere PowerCLI cmdlets immediately and also take advantage of the new Windows PowerShell Integrated Scripting Environment (ISE) features (for example, Intellisense);

Intellisense-Connect-VIServer

You can repeat the same process for any third party PowerShell  snap-ins that you already use.

If you don’t want to repeat this process every time, then simply setup a PowerShell profile which adds the snap-in as soon as you launch PowerShell.

 124,041 total views,  2 views today

Author: Jon Munday

An independent IT contractor with a strong focus on VMware virtualisation and infrastructure operations. I am inspired by technology, not afraid to question the status quo and balance my professional commitments with entertaining my three awesome kids (Ashton, Oliver and Lara).

One thought on “Take advantage of Windows PowerShell 3.0 to manage your VMware environment”

Leave a Reply

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