# encoding: ascii
# api: powershell
# title: EmailService
# description: Simple one liner that emails the status of a service(s) to a recipient.
# version: 1.04
# author: Johnny Reel
# license: CC0
# x-poshcode-id: 4652
# x-archived: 2013-12-06T18:09:13
# x-published: 2013-11-27T16:33:00
#
#
# Email-ServiceStatus
# Version 1.04
# Johnny Reel
# 11/26/13
# Suggested use is to run as scheduled task on a server. Will email the status of service(s) to recipient(s).
Send-MailMessage -To "user@company.com" -From "sender@company.com" -SmtpServer <servername> -Subject "<service or server name> Service Status" -body ((gsv -cn <servrename> -Name <servicename>) | Out-string)
exit 4