DRY?  Does this mean I can’t use PowerShell on a water-cooled PC?

DRY is a principle that can be very familiar to the PowerShell aficionado with a development background.  DRY means Don’t Repeat Yourself.  Keeping your scripts DRY means that our scripts don’t contain repeated code.  Copy/Paste is not your friend!

Why should PowerShell scripters care about keeping their PowerShell DRY?  One major reason – script maintainability.

PowerShell has a huge advantage over scripting environments/shells in that the noun/verb structure lends itself to very readable scripts.  If there is duplication in your code, that readability can give a PowerShellers a bit of overconfidence when reading/modifying scripts that are new to them or that have not been looked at in a while.

If you find yourself copying and pasting lines of PowerShell between different sections of your script, you could be setting yourself up for some interesting times when you need to make a change.

Want more great reading? Check out my reading list!