I write a lot of PowerShell scripts. Like a lot, a lot. I write them for any manner of things, but recently I’ve been tasked to help out with a few Server & Application Monitor templates. These are some of the most interesting things that SAM has to offer.
Looking at each of the scripts, I decided it was worth revisiting based on some of my newly acquired PowerShell superpowers (cape not included).
SAM script templates (Windows Scripting, PowerShell, Perl, Python, whatever) require two things – a statistic and an exit code.