I have created the following powershell script:
stop-service ''3456''
start-sleep -s 60
stop-service "2354"
start-sleep -s 60
Restart-computer QY34 -Force
send -mailmessage -from operating.system@abc.com -To asdf@abc.com -subject test -attachment 'c:\Temp|test.log' -smtp server "127.0.0.1"
I have entered the following information on windows task scheduler
On Actions Tab;
C:\windows\System32\windowspowershell\v1.0\powershell.exe
Arguments Tab:
-file "c:\scripts\test.ps1"*>"c:\Temp\test.log"
Can anyone please help me in getting the log file while running the script via Task Scheduler?