Information Technology Reference
In-Depth Information
the install that there is a custom option to also install and enable the vCloud Director snap-in.
Additional snap-ins are available for download to manage VMware View and VMware Update
Manager (VUM), and installation of these snap-ins is similar to the PowerCLI installation. The
core PowerCLI components include over 370 cmdlets providing considerable capabilities, with
more available with the additional snap-ins.
PowerCLI Backward Compatibility
VMware has done an excellent job making the newest version of PowerCLI backward compatible
with previous versions of vSphere. You'll always want to check the release notes of the latest version
of PowerCLI to ensure that your scripts w ill run properly against your env ironment. PowerCLI 5.5
supports vSphere 4.0 Update 4 and greater.
One exception to backward compatibility with PowerCLI is with the VMware Update Manager
(VUM) snap-in. You'll always need to have the version of the snap-in that matches the version
of VUM you are running. Keep this in mind when upgrading PowerCLI. In our environments, we
would generally have a specifi c server, sometimes the separate VUM server itself, confi gured with
the correct version so that we could update our core systems more freely.
Getting Started with PowerCLI
The i rst and most important thing to remember about PowerCLI is that the PowerShell <verb>-
<noun> nomenclature for cmdlets makes them easy to read and also makes it easy to i nd the
right cmdlets for the job. In the following sections, we'll go through the basics starting points
of PowerCLI. By the end of this discussion, you'll be able to connect PowerCLI to your vSphere
resources, locate the cmdlet that you need, get information about how to use that cmdlet, and
start creating “one-liner” scripts. These are the i rst steps to automating vSphere with PowerCLI
and skills that you will use frequently as you become a more mature user.
Finding Cmdlets
VMware has provided a special cmdlet in PowerCLI to aid in i nding the cmdlet that you need,
Get-VICommand. Get-VICommand is much like Get-Command but is specii c to the PowerCLI-
provided cmdlets. Let's say that you are looking for available cmdlets for managing your logs.
Using the following code, you'll receive a listing of available log cmdlets:
Get-VICommand *log*
Alternatively, you could also use the Get-Command cmdlet and narrow your search criteria to
only the <noun> section of the cmdlet.
Get-Command -Noun *log*
If you tried these cmdlets, you'll notice that using the Get-Command cmdlet returns more
results. Why is this? The Get-Command cmdlet will return all PowerShell cmdlets that contain
log in the cmdlet noun section, whereas Get-VICommand will return only those associated with
PowerCLI.
 
Search WWH ::




Custom Search