Scheduled Task:
- Create the Task and the Time
- Run as Administrator
- powershell.exe -nologo -command "&{c:\MyTask.ps1}"
Run as a Windows Service
- Download RunAsService
- Run through the basic installation and set up the user to run the service (or local if that is all that is needed)
- In the .config used by RunAsService
<service.settings>The only way I know how to do this currently is with some open source. Please let me know if there is another way.
<service>
<name>POSh Service</name>
<executable>powershell</executable>
<parameters>-file "C:\MyPOShServices\runmon.ps1"</parameters>
</service>
</service.settings>
</pre>