Book Image

PowerCLI Essentials

By : Chris Halverson
Book Image

PowerCLI Essentials

By: Chris Halverson

Overview of this book

Have you ever wished you could automatically get a report with all the relevant information about your VMware environments in exactly the format you want? Or that you could automate a crucial task that needs to be performed on a regular basis? Powerful Command Line Interface (PowerCLI) scripts do all these things and much more for VMware environments. PowerCLI is a command-line interface tool used to automate VMware vSphere environments. It is used to handle complicated administration tasks through use of various cmdlets and scripts, which are designed to handle certain aspects of VSphere servers and to help you manage them. This book will show you the intricacies of PowerCLI through real-life examples so that you can discover the art of PowerCLI scripting. At the start, you will be taught to download and install PowerCLI and will learn about the different versions of it. Moving further, you will be introduced to the GUI of PowerCLI and will find out how to develop single line scripts to duplicate running tasks, produce simple reports, and simplify administration. Next, you will learn about the methods available to get information remotely. Towards the end, you will be taught to set up orchestrator and build workflows in PowerShell with update manager and SRM scripts.
Table of Contents (13 chapters)
PowerCLI Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Code repositories – why would I need that?


The first thing when developing code, by spending hours designing and writing the script, is to find the script afterwards. I, personally, have spent days writing a script, to do something that I feel will be useful, and placed it in a folder on my computer and then have completely forgotten about where it is when I need it again 3–6 months later. Another example of this is when I was in the midst of writing a script just to find out a work associate is writing the same thing, and lastly, I pass along a script that I have worked on for a few days to another member on the team, they attempt to run the script, and respond, "It doesn't work."

Having a well-defined repository and a good definition of the script gives all who may be developing in it an open and robust place that everyone on the team can build upon. A repository can consist of a shared folder on a centralized file share, a document share such as SharePoint, a commercial code repository...