Powershell - Script runs from PS-Command but not Task Scheduler
Guten Morgen,
ich habe am WE folgendes Problem nicht loesen koennen.
Ich habe folgendes Script, welches diverse Backup-Prozesse (Script von Michael Seidl aka Techguy) nacheinander starten soll.
Vom Powershell Terminal aus geht das auch einwandfrei und problemlos. Leider jedoch nicht vom Task-Scheduler. Im Task-Scheduler mochte ich das mit dem Command
und dem Argument
laufen lassen. Das Script laeuft auch an, jedoch stopt es unverzueglich und sagt dann
Was mache ich hier falsch? Warum kann ich das Script vom terminal aus starten und es laeuft durch wie beabsichtigt, aber nicht vom Task Scheduler? Hat jemand eine Idee?
VG Peter
ich habe am WE folgendes Problem nicht loesen koennen.
Ich habe folgendes Script, welches diverse Backup-Prozesse (Script von Michael Seidl aka Techguy) nacheinander starten soll.
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\WNCSM_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\WNCSC_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\WNIC_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\SC_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\VG_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\AA_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\T3G_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\GNM_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\GNG_BackupScript.ps1"
& Pwsh -ExecutionPolicy Bypass -File "C:\Backup\A_BackupScript.ps1"
Vom Powershell Terminal aus geht das auch einwandfrei und problemlos. Leider jedoch nicht vom Task-Scheduler. Im Task-Scheduler mochte ich das mit dem Command
C:\Program Files\PowerShell\7\pwsh.exe
-File "C:\Backup\test.ps1"
13.12.2020-21:20:15: <Error> <7256> One of the Directories are not available, Script has stopped
Was mache ich hier falsch? Warum kann ich das Script vom terminal aus starten und es laeuft durch wie beabsichtigt, aber nicht vom Task Scheduler? Hat jemand eine Idee?
VG Peter
Please also mark the comments that contributed to the solution of the article
Content-Key: 631592
Url: https://administrator.de/contentid/631592
Printed on: April 27, 2024 at 08:04 o'clock
5 Comments
Latest comment