O'Reilly logo

PowerCLI Cookbook by Philip Sellers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required