I created a custom command and pasted the script in as a powershell script, then created a scheduled task to run it, but there are no results, nothing has been changed.
I opened the custom command, and hit the "RUN" button from there, and it worked.

Why would it not work when I ran it the other way?
Thanks