liveBook · Manning

Toolmaking

As explained in Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools

Toolmaking is an approach to PowerShell development that creates small, reusable, self-contained, context-independent tools that can be composed with other tools.

Toolmaking treats PowerShell development as the creation of small, reusable, context-independent commands. Each tool does one useful thing well, then connects with other tools to solve larger administrative problems. section 1.1

Design tools around these practical principles:

  • Keep each tool focused on one task. Retrieve service information with Get-Service, for example, and use Stop-Service separately to stop a service. section 8.1
  • Favor pipeline input over special-purpose parameters. A command accepting computer-name strings can receive them directly, from a file, or through another command. section 8.1 section 4.0
  • Replace monolithic sequences with self-contained functions. Individual boundaries are easier to write, test, debug, reuse, and maintain. section 17.2.2
  • Build from commands first. Discover syntax, query the required data, test interactively, and refine before adding script logic. section 9.1 section 9.7

From file-handling logic to composition

A less effective design gives Get-CompanyStuff both -ComputerName and -FilePath, making one tool responsible for two tasks. A composable design lets Get-Content read the file and passes its results through the pipeline to Get-CompanyStuff. section 8.1

Get-Content servers.txt | Get-ServerInfo

See the compact pipeline form that separates file reading from server information retrieval. section 8.1

A larger workflow can still have a clear purpose when controllers connect focused tools. For example, separate functions can connect to Microsoft Graph, read a password-expiration window, identify affected users, and send notifications. section 17.2.2

Start with a small problem, apply the design deliberately, and improve existing scripts when bugs or new features create an opportunity. Practical use turns toolmaking principles into working habits. section 27.1 section 27.2

How Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools covers it

How deep it goes
Explains single-task boundaries, pipeline composition, command discovery, modular functions, and iterative testing, then defers broader implementation details.
Examples
Uses Get-Service, Get-Content, server-information commands, CIM discovery, and decomposed Microsoft Graph password-expiration functions.
What it assumes
Assumes basic PowerShell experience, command-line experimentation, help-file use, and command discovery rather than teaching those foundations from zero.
What you can do after
Build small PowerShell tools that accept pipeline input, compose with existing commands, and remain easier to test and maintain.
How it connects
Connects scripting with commands, functions, script modules, parameter binding, the PowerShell pipeline, testing, debugging, and maintenance.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools. The section links point to the parts of the book it draws on.