QuickTip: Add VMware PowerCLI to PowerShell Console

Although officially the PowerCLI cmdlets are only supported by VMware when running the PowerCLI console it is possible to add the majority of the PowerCLI cmdlets by manually adding the VMware.VimAutomation.Core snapin in your current console:

Add-PSSnapin -Name VMware.VimAutomation.Core

This is particularly useful when running PowerCLI script from the task scheduler as the scripts can just be executed using PowerShell.

As suggested in the comments it is also possible to add all registered VMware PSSnapin’s by runing the following code:

Get-PSSnapin -Registered |
Where-Object {$_.Name -like 'vmware*'} | ForEach-Object {
    Add-PSSnapin -Name $_.Name
}
Share

2 thoughts on “QuickTip: Add VMware PowerCLI to PowerShell Console

  1. Anonymous

    Great tip! You can also do something like the following to add all registered PSSnapins:

    Get-PSSnapin -Registered |
    where name -like vmware* | foreach {
    Add-PSSnapin $_.Name
    }

    Reply

Leave a Reply