Istanbul/Turkey

Configuring PowerCLI

Start Powershell as administrator and type the command below to check PS version:

$psversiontable

If your PS version is 5.1 or higher you can directly download or update powershell modules from the shell. Create a folder named PowerCLI under C and run the command below. PowershellGet requires Nuget Provider. Type "Y" to accept.

Save-Module -Name VMware.PowerCLI -Path c:\PowerCLI

 

You can see PowerCLI modules are downloaded under C:\PowerCLI folder. Now we need to install these modules into Powershell by running the command below. Type "Y" and hit enter.

Install-Module -Name VMware.PowerCLI

 

 

After the installation of modules are completed, you can connect to vcenter by running the command below.

connect-viserver  <Vcenter-IP-Address>

 

 If you have problems while connecting to vi server, run the commands below

Set-ExecutionPolicy -ExecutionPolicy unrestricted
Import-Module VMware.VimAutomation.core
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore

 

Now you can run PowerCLI scripts just like you run powershell scripts. 

  • Hits: 537