However, today I bumped into an issue where the task server refused to run the script. It was not a PS issue at all. The task engine of the server itself generated a Security Warning:
While scripts from the internet can be useful, this script can potentially harm your computer. Do you want to run <script name>?
[D] Do not run [R] Run Once [S] Suspend [?] Help <default is ‘D’>:
The related server runs Windows Server 2008 R2. So the security settings were stopping the scripts. Which came straight from the internet (my SkyDrive). After having changed the properties of the two related scripts (Unblock) all run fine. No errors what so ever.
Lesson learned: When running Windows 2008 Server R2, and using something downloaded from the internet ALWAYS check the properties and remove the blockage. Otherwise it won’t run as expected.