I recently wrote this script to schedule Memory and vCPU up/downgrades on virtual machines from a VMware PowerCLI enabled vCenter server running Windows.
The script is built upon many useful parts from a script that I found here:
I mainly had to make changes in order for the script to be able to run from Task Scheduler. First of, the script needed to be executed as a different account, one that has permissions in your VMware Cluster to reboot and change configuration of virtual machines. So I created the user svc_sched_script in VMware vCenter and gave it enough permission.
I then needed to save the password (not in clear text) and pass it to the script somehow.