Forum Discussion
deepak216632160
Jan 03, 2020Copper Contributor
task scheduling to automate send email and start the pm2 services
I have created a website named abccompany.com and used a node js with pm2 services. now I want to use task scheduled like that whenever my website goes down or services goes offline it checks for pm2...
chrisream
Microsoft
Jan 23, 2020Are you looking for a starting point or a full solution?
#Start your script with a test of services:
$Running = get-service w3svc
#Then do an If/Else
If ($running.state -eq "Running") {}
Else {Start-service w3svc ; Send-mailmessage <lookup this cmdlet and provide values for the parameters> }