Chapter 8. Always design first

Before you sit down and start coding up a function or a class, you need to do some thinking about its design. We almost constantly see toolmaking newcomers start charging into their code, and before long they’ve made some monstrosity that’s harder to work with than it should be. In this chapter, we’re going to lay out some of the core PowerShell tool design principles, to help you stay on the path of Toolmaking Righteousness. To be clear, all we’re doing here is building on what we laid out in part 1 of this book. Now we’re ready to provide some more concrete examples.

8.1. Tools do one thing

As we’ve mentioned before, the Prime Directive for a PowerShell tool is that it does one thing. You can see this in almost ...

Get Learn PowerShell Scripting in a Month of Lunches now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.