PowerShell task runs indefinitely - VisualCron - Forum

Community forum

SafonovPA
2019-01-09T11:21:55Z
Greetings!

Got a PS task that sometimes "hangs". Only this task got this issue
Task AND job got a timeout settings set to 1 minute, but it's not working. It's impossible to stop the task - only by VisualCron service restart.
User that runs visualcron jobs doesnt have an active PS process when task hangs.
PS runtime.PNG

Code (mb this will help):
if ((Get-Service -ComputerName "bigtn12" "Rabbit TB Service").status -eq "Running")
{exit}
else {Send-MailMessage -From "VisualCronAlerts <VisualCronAlerts@berg.ru>" -To helpdesk_it@berg.ru, it_robot@berg.ru -Subject "Служба Rabbit TB Service не в состоянии 'Running', перезапустите службу" -Body (((Get-Service -ComputerName "bigtn12" | Where-Object {$_.name -eq "Rabbit TB Service"} | out-string)) + "Это письмо генерируется заданием 'Проверка статуса службы RabbitTBService' в планировщике заданий VisualCron на сервере Bigtn11.") -SmtpServer mail.brg.loc -Encoding ([System.Text.Encoding]::UTF8) }
exit


Support
2019-01-09T13:36:19Z
When it hangs, try stopping the process TaskPowerShell.exe. Then copy standard and error output here.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
SafonovPA
2019-01-09T13:56:37Z
Killed process TaskPowerShell
no erros, job is still marked as running

note:
this jobe has conditions, could it be the issue?
Scroll to Top