Forum Discussion
Tim McGrath
Jan 10, 2024Copper Contributor
PowerShell doens't run correctly from scheduled task
Hello - We have a PowerShell script that modifies data and then renames the file. When we run this script manually it works as expected. When we run it as a scheduled task, the data is not modified...
- Jan 10, 2024Adding a Start-Transcript c:\temp\log.txt at the top and a Stop-Transcript at the bottom doesn't tell you anything afterward in the log.txt file?
Tim McGrath
Jan 11, 2024Copper Contributor
When I run the scrip manually it creates the log file... when I run it in scheduled task.... does not create the file.... BUT the script changes the csv file name
Jan 11, 2024
And what is in the log file? Are you sure that the script that you edited (Adding the Transcript lines) is the one being used?
- Tim McGrathJan 11, 2024Copper Contributorthank you for the responses. I was actually able to get it to work correctly by removing spaces in the file name and changing Actions:
Program/script: Powerschell.exe
Add Arguments: ./namenospaces.ps1
Start in: e:\pathtofile (e is local data drive)
Script runs, Log file that was was recommended by Harm Veenstra is created, data in the csv file is updated.!- Jan 11, 2024Nice to hear that it worked!