Executing a script calling a module from task scheduler not fully working
hello,
have module checks datetime of backup files make sure written within past 3 days, if finds it, execute lot of sql stored procs within powershell. this works fine when manually execute it, doesn't execute past import-module command when call task scheduler.
task scheduler action: start program
program/script: c:\windows\system32\windowspowershell\v1.0\powershell.exe
arguments: -noexit c:\scriptsfolder\dbrefresh.ps1 #leaving noexit testing. fails or without.
when finishes, see imported modules none of actions taken. here script i'm using call module.
param( $si = "localhost\qainstance", $bupath = "\\backuppath\backupssubfolder\env\blah", $dbn = ("database1","database2") ) #import-module dbrestore -verbose -force dbrestoreexecutor -backuppath $bupath -serverinstance $si -dbname $dbnhave tried commenting out import-module , still has same effect.
what user account under scheduled task running ?
thing might throw error.
knowledge power{shell}
dexterposh
my blog
Windows Server > Windows PowerShell
Comments
Post a Comment