I read this article which was really promising, but I am a N00B to Powershell, and I can't seem to troubleshoot my errors.
Essentially, I want a powershell script that runs (send me and e-mail notification)when any of my SQL services stop.
This website sounds like it is so easy, but after several hours of trying, I am not having any luck.
Any help would be appreciated
I get the following error when testing:
Missing expression after unary operator '-'.
At line:1 char:2
+ - <<<< Comandlet `Send-MailMessage
+ CategoryInfo : ParserError: (-:String) , ParentContainsErrorRecordE
+ FullyQualifiedErrorId : MissingExpressionAfterOper