Skip to content

install.ps1 narrates, fails and runs programs as the PowerShell style guide's section 7 says #1044

Closed

Description

@David-Noble-at-work

The PowerShell style guide's section 7, Messages and Failure (NobleFactor/noblefactor-engprod#311, 0f8b2fd, 2026-10-18), says how a script narrates, fails and reads native programs. install.ps1 on develop (4d18e48c; last changed by #1032) predates it. Compared 2026-10-19:

Area Section 7 install.ps1 today Line
🔴 Streams Narration goes to Write-Verbose; nothing goes to the information stream All narration goes to Write-Information (Write-Info, Write-Success, blank lines) 147, 158, 749
🔴 Streams No stream is turned on by force Every Write-Information carries -InformationAction Continue throughout
🔴 Streams A result is an output object The usage, the PATH advice, "Verify installation" and the next steps are information-stream text 76–92, 919–963
🟢 Streams A warning goes to Write-Warning It does 169
🟢 Streams No Write-Host None —
🟢 Streams The caller's preferences stay the caller's Only $ErrorActionPreference is set —
🔴 Errors Note the caller's error action, then set Stop Sets Stop without noting the caller's 68
🔴 Errors Catch every error; restore the caller's error action; report with $PSCmdlet.WriteError Main has try/finally only; errors leave the script uncaught 800, 866
🔴 Errors A refusal is the script's own ErrorRecord, with an id and a category Write-Fatal throws a string, at about twelve call sites 184
🔴 Errors Off Windows, the RequiresWindows record Get-OSName throws the string "This script requires Windows." 201
🟡 Errors exit 1 after reporting Never exits: under irm | iex and the script-block form, exit ends the user's session (#965). Ruled below: return 72, 184
🟢 Native programs Read through .NET Process, UTF-8 with no BOM It does 615–625
🟢 Native programs Each argument passed as given ArgumentList on PowerShell 7; one quoted command line on Windows PowerShell 5.1, which a fresh Windows machine has (#948) 629–636
🔴 Native programs Standard input redirected and closed Only stdout and stderr are redirected 617–638
🔴 Native programs What the program narrates goes to verbose Each line of its stderr goes to Write-Information 646

Ruled 2026-10-19

Asked whether the catch ends with section 7's exit 1 or returns, as #965 requires: "return, per #965. file it."

Resolution

A plain irm | iex run then shows warnings, errors and its results; progress shows with -Verbose.

Plan and design documents

Kind Document
Plan docs/plans/chore/1044-install-ps1-narrates-fails-and.md
Design docs/architecture/10-command-line-interface.md, § 2, The installers
Guide PowerShell style guide, § 7, Messages and Failure

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions