Forum Discussion
Paul McLaughlin
Jul 11, 2017Copper Contributor
Task Scheduler to run PowerShell
Hello I have a windows PowerShell Script that I made to move a folder to anther folder on the same drive. (move-item 'E:\System State Folder' 'E:\Backup Folder') Action : Start a Program, Program/sc...
VasilMichev
Jul 11, 2017MVP
And you might also need to run the script as administrator. In any case, add some logging/debugging capabilities in the script in order to troubleshoot it properly.
Paul McLaughlin
Jul 11, 2017Copper Contributor
I have in the task scheduler run as administrator but still nothing, I can run the script by using the open with PowerShell and it will work. Just cant get the darn to work as a task.
- MaluksJul 11, 2017Iron Contributor
Paul, as I mentioned you are mising "-file" parameter, as from the script I see that you have mixed it with "-Start in" as this should be the directory where the script should run and not the path to your script as this parameter is optional
- Paul McLaughlinJul 12, 2017Copper Contributor
It works great thanks for the quick response .
- Paul McLaughlinJul 11, 2017Copper Contributor
Sorry I didn't see your post earlier I will give it a try