I am attempting to create a scheduled task via powershell, to run another powershell script which will call a number of other scripts on a daily basis.
When running any of these scripts from Powershell directly/manually, there are no issues - each script performs it's function with no issues whatsoever.
However, despite this, when attempting to run the task, I am hitting a brick wall with exit code 0x1
.
I have researched this and tried a number of various arguments:
- Have attempted running with "Powershell" as the program, with the file path to the system folder storing powershell, or simply as PowerShell, or Powershell.exe.
- Have attempted the above (in every variation) with the
-ExecutionPolicy Bypass
switch. - Have attempted the above with
-File "C:\Test\V2\Master.Script.ps1"
and combined this with-ExecutionPolicy Bypass
switch. - Attempted with
"-NonInteractive"
switch. - Running as System
- Running with Highest Priveleges
- Running whether user is logged on or not
- Tested using Domain User account which is Local Admin (On live environment, will have access to local admin or system only)