PowerShell: Use Connect-VIServer In Your Script


To use ‘Connect-VIServer’ cmdlet in your PowerShell script. You have to follow two steps:

1) Install VMware PowerCLI in your machine. It will register itself in PowerShell during the installation.

2) Use ‘Add-PSSnapIn VMware.VimAutomation.Core’ to add the registered PowerShell VMware Snapin to the current session.

image

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s