PowerCLI scripts
VMware PowerCLI is an extremely powerful tool, and there are countless blogs, forums, and conversations in VMware communities that provide complex scripts and one-liners to better serve and manage your infrastructure. In this recipe, we'll discuss a few samples and syntaxes of some very powerful one-liners that are useful when managing as small as a single VMware vCenter with three ESXi hosts or as complex as thousands of vCenter systems with hundreds of thousands of hosts.
How it works...
This recipe is divided into two sections: one-line scripts and multiline scripts. One-line scripts can be entered in the PowerCLI window itself. For multiline scripts, it is a good idea to write the script in the PowerShell ISE, then run it in the PowerCLI window.
PowerCLI Scripts – one-liner
The one-liners and scripts that will follow touch specifically on items that can often have a direct impact on your virtual environment or VM performance, so they should be used appropriately to identify...