8 Always design first

 

Most of our scripts start as a simple one-line command to do a thing, such as creating a new user. The script will read from a CSV, 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 the hip. 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’ll lay out some of the core PowerShell tool design principles to help you stay on the path of “Toolmaking Righteousness.” To be clear, we’re 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

Summary