Unless you’re new to vSphere, you’ll probably have heard about PowerCLI. You may already be using it regularly or perhaps you’ve found the occasional use for it and used one or more of the many excellent scripts that can be found on the internet. Either way, unless you’re an advanced user (or even a guru) of PowerCLI, there’s a book that’s been released recently that could be worth a look.
“Learning PowerCLI”, by Robert van den Nieuwendijk, was released just a few weeks ago from publishers Packt Publishing. The author has posted many times on his blog with useful scripts, one-liners and tips for using PowerCLI in the past. Several times an issue that I’ve had has lead me to his blog so I was very interested to see if his knowledge and experience had translated well into book form.
Although I did read through the book from cover to cover, it’s not really that sort of book. PowerCLI and Powershell are technologies that you can easily dip into when a specific need arises and I found that trying to absorb the entire contents of the book was hard-going. That shouldn’t be taken as any sort of slight against the author’s writing style, it’s just the subject matter doesn’t lend itself to being the kind of book that you can’t put down. It is, though, the kind of book that you want to pick up and learn from. I’ve been using Powershell and PowerCLI for many years and I was surprised at the number of things that I learned!
The book starts simply enough by covering the installation and instantiation of PowerCLI as well as proving a few common examples of PowerCLI’s most commonly used cmdlets so that a reader new to the technology can see some immediate benefit. Before things get too heavy, Robert covers some of the most useful Powershell commands available: Get-Help, Get-Command and Get-Member. He also covers a number of useful Powershell tips and best practices whilst simultaneously keeping the reader’s mind on PowerCLI before delving into some more focussed topics, such as:
- Working with vSphere hosts
- Working with Virtual Machines
- Working with Virtual Networks and Storage
- Managing core vSphere / vCenter functionality
As I’ve already stated, I found the book very useful as it taught me a number of things I didn’t already know, allowing me to correct some bad scripting habits and improve a number of areas of scripts that I’m producing for a current project. People with a very strong grasp of Powershell and PowerCLI already might find that there’s a limit to what they gain from the book but beginners and intermediates alike should find that there’s plenty to take away and use.