vSphere Administrators commonly encounter scenarios where a subset of VMs must be powered off, powered on, or power cycled, due to internal requirements or in response to technical issues. The process can be burdensome when performed manually, especially in environments which require a staggered approach to prevent boot storms. This script empowers vSphere Admins to provide a list of VMs using a CSV or text file and define the maximum number of concurrent power operations at a global, Host, and/or Datastore level. The default behavior will follow an escalation path by first attempting to execute a Guest OS Shutdown (using VMware Tools), escalating to a Power Off operation as needed, and finally executing a Hard Stop operation as a last resort. The vSphere Admin controls whether the script will power down, power on, or power cycle the list of VMs.
Requirements, Instructions, and Full Overview
https://vchamp.net/automating-vm-power-operations-in-vcenter-without-powercli/
Complete Documentation
https://github.com/vchamp-blog/powershell/tree/main/Invoke-VMPowerOps
#VMwareCloudFoundation
#API