Powershell Send email on scheduled task failure

From http://www.snipplr.com/view.php?codeview&id=23068