PowerShell scripts to automate VMware ESXi hosts patching
Assume you have:
- vSphere version 6.5 or later
- PRTG for monitoring
- PowerCLI module
- PrtgAPI module
The main script does the following
- Ask for priviledged account credential.
- Pause PRTG sensors before patching.
- Prompt for acknowledge to kick off patching.
- Move VMs off the host.
- Update the host.
- Move VMs back onto the patched host.
- Move onto next host.
- Resume sensors after successful patching.