After creating a new PowerShell task and copying some parameters from my “old” task i get this strange error code.
How to Run PowerShell scripts from Task Scheduler:
Create new task.
Give it a name.
Run whether user is logged on or not.
Run with highest privileges
Configure for: Highest OS Available
Give it a trigger.
Actions, start a program:
- Program: powershell.exe
- Arguments: -ExecutionPolicy Unrestricted -FILE “C:\PathToPSFile.ps1”
As you can see in the Picture below i get both error codes 0xFFFD0000 and 4294770688.
After troubleshooting a lot with rights, execution policies and other stuff i figured out that Windows did not copied my command very well.
When i copied my arguments to a Command Prompt i saw the strange non-utf character like the picture below.
Removing that character did the trick.