Great post, thank you very much!
I am having the same issue as @MagnusL - The scheduled task is been created but the account that it is been assigned to 'When running the task, use the following user account:' is 'defaultuser0'. This means that scheduled task does not run, as its not been created under the user who logs into the device.
The only section that has been edited in your script is the '$websiteURL =' as per your instructions.
Looking at your script, I couldn't work out which section stops the user, 'defaultuser0', from running it?
Any help will be greatly appreciated|, thanks.