Log file not being generated while running a PowerShell script via Windows Task Scheduler.
Script as below:
stop-service "3900" start-sleep -s 60 stop-service "3200" Restart-computer Q234X -Force Send -MailMessage -From operating.system@xyz.com -To abc@xyz.com -subject test -attach "c:\Temp\test .log" -smtpserver "127.0.0.1"
In windows task scheduler I have entered the following information:
In Action tab:
C:\windows\system32\windowspowershell\v1.0\powershell.exe
Arguments tab:
-file “c:\scripts\New_test.ps1”*>“C:\Temp\New_test.log”
Can anyone help me in getting the log file while running the script via Task Scheduler?