Mastering PowerCLI

Master PowerCLI to automate all aspects of VMware environments
Preview in Mapt

Mastering PowerCLI

Sajal Debnath

1 customer reviews
Master PowerCLI to automate all aspects of VMware environments
Mapt Subscription
FREE
$29.99/m after trial
eBook
$30.80
RRP $43.99
Save 29%
Print + eBook
$54.99
RRP $54.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$30.80
$54.99
$29.99p/m after trial
RRP $43.99
RRP $54.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Mastering PowerCLI Book Cover
Mastering PowerCLI
$ 43.99
$ 30.80
Learning PowerCLI - Second Edition Book Cover
Learning PowerCLI - Second Edition
$ 39.99
$ 28.00
Buy 2 for $35.00
Save $48.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781785286858
Paperback430 pages

Book Description

Have you ever wished that every morning you could automatically get a report with all the relevant information about your datacenter in exactly the same format you want? Or whether you could automate that boring, exhausting task? What if some crucial task needs to be performed on a regular basis without any error? PowerCLI scripts do all that and much more for VMware environments. It is built on top of the popular Windows PowerShell, with which you can automate server tasks and reduce manual input, allowing you to focus on more important tasks.

This book will help you to achieve your goals by starting with a short refresher on PowerShell and PowerCLI and then covering the nuances of advanced functions and reusable scripts. Next you will learn how to build a vSphere-powered virtualized datacenter using PowerCLI while managing different aspects of the environment including automated installation, network, and storage. You will then manage different logical constructs of vSphere environment and different aspects of a virtual machine.

Later, you will implement the best practices for a security implementation in vSphere Environment through PowerCLI before discovering how to manage other VMware environments such as SRM, vCloud Director and vCloud Air through PowerCLI. You will also learn to manage vSphere environments using advanced properties by accessing vSphere API and REST APIs through PowerCLI.

Finally, you will build a Windows GUI application using PowerShell followed by a couple of sample scripts for reporting and managing vSphere environments with detailed explanations of the scripts. By the end of the book, you will have the required in-depth knowledge to master the art of PowerCLI scripting.

Table of Contents

Chapter 1: PowerShell and PowerCLI Refresher
The essence of PowerShell and PowerCLI
Implementing programming constructs in PowerShell
Automation through PowerShell scripts
Running and scheduling scripts
Using version control with GitHub
Testing your scripts using Pester
Connecting to a vCenter and other VMware environments using PowerCLI cmdlets
Summary
Chapter 2: Reusable Advanced Functions and Scripts
Specifying function attributes
Specifying parameter attributes
Using parameter validation attributes
Dynamic parameters
Switch parameters
PowerShell help files
Creating comment-based help
Error handling in PowerShell
Summary
Chapter 3: Deploying vSphere Hosts
Image Builder with PowerCLI
Using host profiles
Configuring Auto Deploy for ESXi hosts
Adding hosts to a vCenter server
Summary
Chapter 4: Managing Networks
Managing vSphere standard switches
Managing networking for ESXi
Managing vSphere distributed switches
Managing port groups
Creating private VLANs
Configuring vSphere network I/O control
Configuring Netflow
Working with ports
Summary
Chapter 5: Managing Storage
Managing datastores
Configuring Fibre Channel storage
Configuring iSCSI storage
Configuring NFS storage
Configuring virtual SAN
Using datastore clusters
Using Raw Device Mapping
Managing storage using storage policy-based management
Applying VMFS resignaturing
Configuring vFLASH using PowerCLI Extensions
Summary
Chapter 6: Managing Clusters and Other Constructs
Configuring vCenter logical constructs
Configuring the Enhanced vMotion Compatibility mode
Configuring High Availability
Using Dynamic Resource Scheduling
Using the DRS affinity and anti-affinity rules
Managing resource pools
Managing alarms
Summary
Chapter 7: Managing Virtual Machines
Creating virtual machines
Modifying virtual machines
Managing templates
Managing OS customization specifications
Managing the guest OS
Managing vApps
Summary
Chapter 8: Managing vSphere Security, SRM, vCloud Air, and vROps
The vSphere Security Hardening Guide
Managing vSphere Update Manager
Configuring a firewall and services in an ESXi host
Managing host profiles
Managing vCenter Site Recovery Manager
Managing vCloud Air
Managing vRealize Operations Manager
Summary
Chapter 9: Managing the vSphere API
Using the Get-View cmdlet to return .NET View objects
Using the ExtensionData property to return .NET View objects
Using the vSphere API
Creating a vSphere scheduled task
Configuring Distributed Power Management
Configuring Fault Tolerance
Managing Content Libraries
Managing SRM advanced configurations
Generating PowerCLI code using Onyx
PowerActions for vSphere Web Client
Summary
Chapter 10: Using REST APIs
Introducing REST APIs
Introducing JSON
The Invoke-RestMethod cmdlet
vRealize Automation REST APIs
Authenticating and getting a vRA token
Managing tenants
Managing machines
Managing approvals
Managing provisioned resources
Managing network profiles
Summary
Chapter 11: Creating Windows GUI
Different ways to create a Windows GUI
Building a GUI using Windows Forms
Using SAPIEN PowerShell Studio
Building GUI using WPF
Summary
Chapter 12: Best Practices and Sample Scripts
Best practices
Security Hardening Script
Capacity check report
Using a proper editor
Summary

What You Will Learn

  • Use GitHub for collaboration and Pester to automate unit tests
  • Write advanced reusable functions and dynamic variables and learn about error handling in PowerShell
  • Automate ESXi host installation using Auto-Deploy, host profile, and host image
  • Implement security best practices in a vSphere data center
  • Manage SRM, vCloud Air, and vRealize Operations environments
  • Access and utilize vSphere APIs to manage advanced aspects of vSphere and work with .NET view objects
  • Utilize REST APIs to manage vRealize Automation environments
  • Create a Windows GUI through the use of PowerShell and Sapien PrimalForms CE

Authors

Table of Contents

Chapter 1: PowerShell and PowerCLI Refresher
The essence of PowerShell and PowerCLI
Implementing programming constructs in PowerShell
Automation through PowerShell scripts
Running and scheduling scripts
Using version control with GitHub
Testing your scripts using Pester
Connecting to a vCenter and other VMware environments using PowerCLI cmdlets
Summary
Chapter 2: Reusable Advanced Functions and Scripts
Specifying function attributes
Specifying parameter attributes
Using parameter validation attributes
Dynamic parameters
Switch parameters
PowerShell help files
Creating comment-based help
Error handling in PowerShell
Summary
Chapter 3: Deploying vSphere Hosts
Image Builder with PowerCLI
Using host profiles
Configuring Auto Deploy for ESXi hosts
Adding hosts to a vCenter server
Summary
Chapter 4: Managing Networks
Managing vSphere standard switches
Managing networking for ESXi
Managing vSphere distributed switches
Managing port groups
Creating private VLANs
Configuring vSphere network I/O control
Configuring Netflow
Working with ports
Summary
Chapter 5: Managing Storage
Managing datastores
Configuring Fibre Channel storage
Configuring iSCSI storage
Configuring NFS storage
Configuring virtual SAN
Using datastore clusters
Using Raw Device Mapping
Managing storage using storage policy-based management
Applying VMFS resignaturing
Configuring vFLASH using PowerCLI Extensions
Summary
Chapter 6: Managing Clusters and Other Constructs
Configuring vCenter logical constructs
Configuring the Enhanced vMotion Compatibility mode
Configuring High Availability
Using Dynamic Resource Scheduling
Using the DRS affinity and anti-affinity rules
Managing resource pools
Managing alarms
Summary
Chapter 7: Managing Virtual Machines
Creating virtual machines
Modifying virtual machines
Managing templates
Managing OS customization specifications
Managing the guest OS
Managing vApps
Summary
Chapter 8: Managing vSphere Security, SRM, vCloud Air, and vROps
The vSphere Security Hardening Guide
Managing vSphere Update Manager
Configuring a firewall and services in an ESXi host
Managing host profiles
Managing vCenter Site Recovery Manager
Managing vCloud Air
Managing vRealize Operations Manager
Summary
Chapter 9: Managing the vSphere API
Using the Get-View cmdlet to return .NET View objects
Using the ExtensionData property to return .NET View objects
Using the vSphere API
Creating a vSphere scheduled task
Configuring Distributed Power Management
Configuring Fault Tolerance
Managing Content Libraries
Managing SRM advanced configurations
Generating PowerCLI code using Onyx
PowerActions for vSphere Web Client
Summary
Chapter 10: Using REST APIs
Introducing REST APIs
Introducing JSON
The Invoke-RestMethod cmdlet
vRealize Automation REST APIs
Authenticating and getting a vRA token
Managing tenants
Managing machines
Managing approvals
Managing provisioned resources
Managing network profiles
Summary
Chapter 11: Creating Windows GUI
Different ways to create a Windows GUI
Building a GUI using Windows Forms
Using SAPIEN PowerShell Studio
Building GUI using WPF
Summary
Chapter 12: Best Practices and Sample Scripts
Best practices
Security Hardening Script
Capacity check report
Using a proper editor
Summary

Book Details

ISBN 139781785286858
Paperback430 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Learning PowerCLI Book Cover
Learning PowerCLI
$ 26.99
$ 18.90
PowerCLI Cookbook Book Cover
PowerCLI Cookbook
$ 39.99
$ 28.00
Troubleshooting vSphere Storage Book Cover
Troubleshooting vSphere Storage
$ 23.99
$ 16.80
Learning VMware NSX Book Cover
Learning VMware NSX
$ 31.99
$ 22.40
VMware vRealize Operations Performance and Capacity Management Book Cover
VMware vRealize Operations Performance and Capacity Management
$ 26.99
$ 18.90
vSphere High Performance Cookbook Book Cover
vSphere High Performance Cookbook
$ 32.99
$ 23.10