I realize I've been playing a bit fast and loose with my shell scripts over the last few months, because I haven't talked about how to ensure that error conditions ...
Business.com on MSN

Understanding functions in PowerShell

Don’t copy and paste the same code over and over again. Instead, create a PowerShell function and save yourself time.