Context
Our PowerShell standard (src/docs/Coding-Standards/PowerShell/) already tells scripts to stay thin and keep logic in functions or modules, and to emit objects rather than text. It does not yet distinguish the two kinds of PowerShell we write, nor say how much a command should shape its output.
Gap
The community guide draws a foundational distinction we are missing:
- A tool is a reusable function (usually in a module) — it takes input only through parameters and emits raw, least-manipulated objects, so it stays reusable in the widest range of situations.
- A controller is a script that automates one specific process by calling tools — it may format or reduce data for presentation and is not intended to be reusable.
- Tools emit raw data (for example bytes, not gigabytes); presentation — rounding, units, tables — happens at the edge, in a controller or via a format view, never inside the tool.
Proposed change
Add a short "Tools vs. controllers" section to Coding-Standards/PowerShell/index.md (or Scripts.md), and an "emit raw data, format at the edge" rule to the output guidance. Tie it to the existing "keep scripts thin" rule in Scripts.md and the "emit objects" rule in index.md.
Source
PoshCode — PowerShell Practice and Style, Best Practices, "Building Reusable Tools" (TOOL-01…TOOL-07).
Acceptance
The PowerShell standard defines tool vs. controller and states that tools emit raw objects while formatting happens at the edge.
Context
Our PowerShell standard (
src/docs/Coding-Standards/PowerShell/) already tells scripts to stay thin and keep logic in functions or modules, and to emit objects rather than text. It does not yet distinguish the two kinds of PowerShell we write, nor say how much a command should shape its output.Gap
The community guide draws a foundational distinction we are missing:
Proposed change
Add a short "Tools vs. controllers" section to
Coding-Standards/PowerShell/index.md(orScripts.md), and an "emit raw data, format at the edge" rule to the output guidance. Tie it to the existing "keep scripts thin" rule inScripts.mdand the "emit objects" rule inindex.md.Source
PoshCode — PowerShell Practice and Style, Best Practices, "Building Reusable Tools" (TOOL-01…TOOL-07).
Acceptance
The PowerShell standard defines tool vs. controller and states that tools emit raw objects while formatting happens at the edge.