I started by creating a new basic task in task scheduler: program/scripts: powershell.exe
The file path was put in “add arguments”: -noprofile -executionpolicy bypass D:\DATA-MEDION\soft_ontwikkeling\powershell\zendRecentPGP16.ps1
.
Before doing this I opened a powershell window as admin and have put the executionPolicy
to unrestricted
.
I still get the “cannot be loaded ...”
security error when running the scheduled task. (Ultrashort powershell window opening and closing).
I ran the same script in a powerscript command box and in powershell ISE and it was OK. Any idea's?