test-windows-installer

Smoke-test PowerShell installer scripts with pwsh to catch exit and download failures.

10|1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/catalystctl/catcode --skill test-windows-installer-catalystctl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-windows-installer
Source: https://github.com/catalystctl/catcode/tree/main/.catalyst-code/skills/test-windows-installer
Command: npx skills add https://github.com/catalystctl/catcode --skill test-windows-installer-catalystctl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Windows installer scripts like install.ps1 can silently close the PowerShell window mid-install when run via irm | iex or scriptblock hosts, and download failures often go unnoticed until users report them. This Skill runs a pwsh-based smoke-test harness that catches Die/exit host-close bugs and download failures before they reach users. ## Core Features & Use Cases - Syntax and Source Guards: Parses install.ps1 and its shim, enforcing that Die uses throw instead of exit and that menu paths do not kill the host. - Host Survival Checks: Verifies the scriptblock host survives a Die throw and that -Update with empty state throws without killing the harness. - Failure Visibility: Confirms bad -BaseUrl fails loudly with a non-zero exit and visible error, plus -Help and -DryRun child runs. - Use Case: After editing Install-Task or Die in install.ps1, run the harness from Linux with pwsh to validate Windows packaging changes before pushing. ## Quick Start Run the Windows installer smoke tests with pwsh against the packaging test script and confirm all checks pass.

Frequently Asked Questions about test-windows-installer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a PowerShell installer script on Linux?

Install pwsh and run pwsh -NoProfile -File ./packaging/windows/test-install.ps1 from the repo root. The harness parses install.ps1, runs source guards, and executes child runs like -Help and -DryRun, printing PASS lines for each check.

Why does my PowerShell window close when running install.ps1 with irm | iex?

Under irm | iex or scriptblock hosts, calling exit terminates the entire PowerShell window, not just the script. Fatal installer errors should use throw instead of exit so the host survives and the error remains visible.

Can I run Windows installer tests without a Windows machine?

Yes, the harness runs under pwsh on Linux. It isolates environment variables like LOCALAPPDATA and TEMP so Linux runs do not write under ~/Programs, and it handles empty $env:TEMP by falling back to TMP, TMPDIR, or GetTempPath.

Why does $ErrorActionPreference Stop break native command calls in installers?

With $ErrorActionPreference set to Stop, native stderr output such as a missing schtasks becomes a terminating error. Use an Invoke-Native wrapper that continues on error and checks $LASTEXITCODE instead.

What installer bugs does the smoke test catch?

It catches Die paths that use exit instead of throw, menu Bye paths that exit the host, shims that exit with $LASTEXITCODE, silent download failures from bad -BaseUrl values, and -Update runs that kill the harness on empty state.