Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PowerCLI Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
PowerCLI Cookbook

PowerCLI Cookbook

By : Philip Brandon Sellers
4.8 (4)
close
close
PowerCLI Cookbook

PowerCLI Cookbook

4.8 (4)
By: Philip Brandon Sellers

Overview of this book

If you are a virtualization professional who wants to unleash the power of automation and combat the complexity of sprawling virtual environments, this book is ideal for you. This book will enhance your skills of administering VMware vSphere and vCloud Director with PowerCLI.
Table of Contents (13 chapters)
close
close
12
Index

Creating a custom function to update members of a DRS group


Updates to DRS group members will likely occur much more often than the initial creation of a DRS group in vSphere. Because of this, creating a function to easily manage and update the members of a DRS group is helpful. In this recipe, you will create two functions that are used to update VM DRS groups and Host DRS groups.

In writing the function, you will begin to take into consideration the type of data that can be passed into the function from your users. This is important to consider, because as you've seen, there can be multiple ways to signify a particular object in PowerCLI that all points back to the same virtual machine. You can have string data, you can pass in a virtual machine object, a MoRef, or a View. All of these are valid representations of a virtual machine. The same is true for other elements in vSphere, such as virtual hosts, datastores, and networking.

To begin writing the function, you will pull back some of...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY