Okay I have a powershell script, it backs up an SQL DB to two locations. It has one command line parameter. If its set to "Midday" it only copies the backup to one location.
The script without parameter runs as a scheduled task. It I added the parameter it doesn't run.
If I run the same command powershell c:\PS_Scripts\backup-db.ps1 "Midday" from Start |Run or a batch file it works. If I schedule the batch file, or the powershell line it doesn't work.
I have tried
powershell C:\PS_Scripts\backup-db.ps1 "Midday"
powershell "C:\PS_Scripts\backup-db.ps1 "Midday""
powershell C:\PS_Scripts\backup-db.ps1 Midday
same line in the batch file, they all run manually but not in a sceduled task.
The script without parameter runs as a scheduled task. It I added the parameter it doesn't run.
If I run the same command powershell c:\PS_Scripts\backup-db.ps1 "Midday" from Start |Run or a batch file it works. If I schedule the batch file, or the powershell line it doesn't work.
I have tried
powershell C:\PS_Scripts\backup-db.ps1 "Midday"
powershell "C:\PS_Scripts\backup-db.ps1 "Midday""
powershell C:\PS_Scripts\backup-db.ps1 Midday
same line in the batch file, they all run manually but not in a sceduled task.