liveBook · Manning

Action tool

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

An action tool is a tool that accepts input and performs an operation or change.

An action tool accepts additional input and performs an operation or change. Its job is the operation itself, not making output attractive or deciding where results go; other tools can handle those concerns. section 6.2

Use action tools as one part of a broader tool relationship:

  • Input tools create data for downstream commands. section 6.2
  • Action tools consume input to perform an operation; Set and Remove are common naming patterns. section 6.2
  • Output tools render or export results for a specific destination or format. section 6.2

Separate account reporting tasks

A password-age report can retrieve account data with Get-AdUser, collect selected attributes, export the data to CSV for SIEM parsing, and separately produce an HTML display. Breaking the work into discrete tasks avoids asking one tool to retrieve, change, and format everything. section 6.2

Install-WindowsFeature -Name "RSAT-AD-PowerShell" `
-IncludeAllSubFeature

Install the required RSAT Active Directory PowerShell feature before using Get-AdUser in the reporting workflow. section 6.2

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

How deep it goes
Defines the role and boundaries of action tools, then stops short of implementing a specific change operation.
Examples
Uses Get-AdUser, selected account attributes, CSV export, SIEM parsing, and HTML reporting.
What you can do after
Apply it via PowerShell by separating data retrieval, operations, and result formatting into discrete tool tasks.
How it connects
Connects action tools with input tools and output tools in a decomposed PowerShell workflow.

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.