PowerShell - Automation Patterns
Consider this script snippet:
What will this script do when available memory is 450 MB?
$mem = Get-Counter '\Memory\Available MBytes' -SampleInterval 1 -MaxSamples 1;$available = $mem.CounterSamples.CookedValue;if ($available -lt 500) { Send-MailMessage -To 'ops@example.com' -Subject 'Low Memory' -Body "Available memory is $available MB" -SmtpServer 'smtp.example.com' }What will this script do when available memory is 450 MB?
