It's good to know how to resolve the problem. But it's better to prevent it.
Configuring VMware vCenter Server to send an alarm when virtual machines are running from snapshots
No console scripts, no powershell, no hassle, just use one of the for many unused and unknown features of vSphere, alarms.