chapter eight

8 Always design first

 

Most of our scripts start out as a simple one-line command to do a thing, such as creating a new user. The script will read from a CSV and make the new users and fill in all the information you received from HR. You save the script in your C:\ drive somewhere and move on to the next fire.

Does this sound familiar? There are two types of scripters and toolmakers in the world. Those who plan and those who shoot from him. Our goal by the end of the book (hopefully even this chapter) is to make a tool designer. Look at it from the process in reverse. What is the desired outcome and how do I get there. Then fill in the blanks from there.

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

8.2 Tools are testable

8.3 Tools are flexible

8.4 Tools look native

8.5 For example

8.6 Your turn

8.6.1 Start here

8.6.2 Your task

8.6.3 Our take