I have a simple powershell job that copies a file from my computer to a network folder. I have verified that it is able to run when manually triggered, but not through task scheduler. When triggering the task from Scheduler the history indicated that it has run as I get both "Action Completed" and "Task Completed".
copy C:\test.txt "\\network\folder\destination\" /Z /Y
On the job itself:
Action:
-Program/Script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
-Arguments: -file "C:\Users\me\Desktop\move.ps1"
Its allowed to run on demand, running through a user with access to the network folder, with highest privileges. Any trouble shooting ideas are greatly appreciated.
copy
is aliased toCopy-Item
, which does not use the same syntax as the CMD.EXEcopy
command. The switches/Z /Y
suggest that you are thinking of the CMD.EXEcopy
command, not theCopy-Item
PowerShell cmdlet. – Jeff Zeitlin