As someone who started using PowerShell since the first release, it is one of my favorite tools. Before coming to work in the vendor space, PowerShell was my go-to tool for management at scale. As an administrator that spent a considerable amount of time working with Windows physical and virtual machines, PowerShell made uniform management (at scale) an easy, consistent, repeatable task.
Not too long after PowerShell was released, VMware released PowerCLI to help with the administration and management of vSphere systems, services, virtual machines and more. It was so much easier (again, at scale) to work with both Windows and vSphere resources at scale.
Over the last 4 years working in VMware’s Storage and Availability Business Unit, specifically as a vSAN focused resource, I’ve spent a lot of time working with PowerCLI and vSAN. It is very common to get requests for a script here or there to do this on vSAN, configure that, and the like using PowerCLI. These often result in code samples that can be reused over and over again.
The number of vSAN related sample scripts on code.vmware.com or Github has grown quite considerably, with many people in the community contributing.
A couple years ago, we put out a vSAN API Cookbook for Python. It was well received, but only had a few sample “recipes.” It can be found on StorageHub.
Today there is a PowerCLI Cookbook for vSAN. It briefly covers how to get started with PowerShell/PowerShell Core/PowerCLI as well as several recipes for Configuring, Operating, and Managing vSAN at any scale.
This is a 1.0 release, and over time, more recipes will be added.
Let us know if there is anything else you would like to see added.
You can find it here: https://storagehub.vmware.com/section-assets/powercli-cookbook-for-vsan
This was originally posted on the VMware Virtual Blocks site: https://blogs.vmware.com/virtualblocks/2019/01/29/powercli-cookbook-for-vsan/