1. I don't know why but that does not work. It does not find the files. I don't know which function fails internally within PowerShell but it does not find any files and because of that it does not work unless you do the workarounds.
2. Maybe because you have not specified the full path to the script? The script worked for me.
I have the entire path on the script. I'm able to get it running without being a 'foreground' process if I run with the following:
Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments: -command "c:\pathToScript\copyfiles.ps1"
Miscellaneous (all unchecked)
Run Task as:
my credentials
Login Type: With Profile -- Run with API Code
I have a feeling that powershell requires the user profile from the local computer. I'm running VisualCron under a domain user and it might not have any settings on this local computer. I would expect the same problem with doing a default install of VisualCron and using the 'Network and because I have VisualCron using 'Network Service' or 'Local System'
I'm going to try this settings on my other more complicated scripts and see if I can get them to run