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

Chapter 1. An Introduction to Essential Administration with PowerCLI

It's 4 pm on a Friday afternoon; you are packing up for a weekend camping trip with the family when your boss walks up to your desk with that I have an immediate task that I need to hand off before I leave for the weekend look on his face. You say, "Hey sir, I am just heading out camping this weekend and I need to beat the traffic, gotta go!" But you are just not that lucky, he quickly replies that his boss has an important meeting and needs some numbers before a Monday morning meeting, and adds, "I don't have the skills in the infrastructure to get this information and I am desperate to get this tonight. Besides, we will all look like heroes if we do this." "Or at least you will", you mutter under your breath.

Is that a normal scenario in your office? It was my role for a number of clients over the last few years until I started predicting the future and writing PowerCLI scripts. This book is a collection of administration experiences for managing a virtual infrastructure and for incorporating the vast skill of DevOps and scripting.

This chapter deals with the getting started mentality, experiencing taking the System Administrator role to the next level, and making the endless job of system operations a bite-sized effort.

In this chapter, you will learn about:

  • PowerShell versions

  • PowerCLI versions

  • Getting PowerShell and PowerCLI

  • Setting up the environment

  • PowerShell basics