PowerShell - Automation Patterns
What happens when this PowerShell script runs?
if (-not (Get-Service -Name 'Spooler' -ErrorAction SilentlyContinue).Status -eq 'Running') { Send-MailMessage -To 'admin@example.com' -Subject 'Service Alert' -Body 'Print Spooler service is stopped.' -SmtpServer 'smtp.example.com' }