use CmdletBinding everywhere to allow exit on first error
set ErrorActionPreference