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.
Thank you Rob for this post!
This helped me a lot!
Glad i could help 🙂
I assume it’s a general syntax error as it also happened to me when I forgot to enclose a filepath with quotes. eg. -file c:\some file with spaces in path.ps1
Thank you very much posting about this issue. I had the exact same issue that could only be seen when the text was copied into CMD/PS or you moved the cursor one character at a time.
You Sir, are a Life-Saver. I would have searched for this, for eternity. Cheers mate!