February 2014
Intermediate to advanced
374 pages
8h 12m
English
Before you can do useful things with PowerCLI, you have to connect to a vCenter Server or an ESXi server. And if you are finished, it is a good practice to disconnect your session. We will discuss how to do this in the following sections.
If you are not connected to a vCenter or an ESXi server, you will get an error message if you try to run a PowerCLI cmdlet. Let's try to retrieve a list of all of your datacenters using the following command:
PowerCLI C:\> Get-Datacenter
The output of the preceding command is as follows:
Get-Datacenter : 12/19/2013 7:29:36 PM Get-Datacenter Youare not currently connected to any servers. Please connect firstusing a Connect cmdlet. At line:1 char:1 + Get-Datacenter ...
Read now
Unlock full access