PowerShell - Automation Patterns
Why does this script fail to send an email?
$disk = Get-WmiObject Win32_LogicalDisk -Filter "DriveType=3" | Where-Object { $_.FreeSpace -lt 1000000000 } if ($disk) { Send-MailMessage -To 'admin@example.com' -Subject 'Low Disk Space' -Body 'Disk space is low' -SmtpServer 'smtp.example.com' }