Ran into an issue lately where I found a host had lost its storage. For whatever reason HA didn’t kick in to bring all the VMs back to life and there was a need to recreate ~75 VMs whom were in an unknown and/or orphaned state. It looked a bit like this:

Unknown VMs

PowerCLI to the rescue!

Note: this was a script that worked in my environment. There is no warranty or support with this script, please use at your own risk.