As said, you need to pay for the ESXi license to use such tools.
The only way to shutdown a free-licensed host is to call the SOAP interfaces like the vSphere client does, which is what my UPS script does. Actualy it's just a shutdown script that I happened to develop to be called by APC's tools, but it can be called by anything (like a scheduled task in your case).
Please award points to any useful answer.