I want to use this Powershell script to automate some backups on Win7 machines. When run manually from the Powershell terminal the script runs as advertised and ends after a few seconds (it is a small backup).
The problem is when I try to automate the process with the Task Scheduler. When the time comes (or when I run the task manually) the script runs and performs the backup correctly. But it does not return to "Ready", even though I know it has ended. I have to stop the task manually each time.
Now, I have not waited to see what happens when the time comes for the task to run again, but I think it will not start a second time, because it is not "Ready".
What can I do about that?
UPDATE 1:
The Action I have chosen is "Start a program". In the "Program/script" box I have "powershell.exe" and as an argument I have the path to the script "*.ps1" file.
UPDATE 1:
I noticed that although the task does not return to "Ready", if I manually start it, it runs again.
-File ".\pathtoscript.ps1"