I have a script that downloads a temporary Excel file, copies parts of it to a new file, and saves it to a specific location on the network. The problem I'm having is that the new file is never created/saved. If I run the script locally (through cmd.exe, powershell, or powershell ise), it WILL save the file locally, or to the network. If I try running the script via a schedule or on-demand via Task Scheduler, the temporary file is created, but the final document is never created or saved. Is there a specific argument I need to pass, or anything I could be doing wrong? This is the command I'm currently using:
powershell.exe -file C:\path\to\my\powershell\script\thescript.ps1
Since it calls environment variables, and other variables relative to the scripts positon, I also set "Start in" to
C:\path\to\my\powershell\script\