A cross-platform PowerShell utility module for creating resumable, step-by-step scripts with automatic state persistence.
Install-Module -Name Stepper -Scope CurrentUser -ForceCreate a .ps1 script with New-Step blocks:
[CmdletBinding()] # required for -Verbose support and error propagation; auto-injected if missing
param() # auto-injected if missing
New-Step 'Download Files' {
Write-Host "Downloading files..."
# your code here
}
New-Step 'Process Data' {
Write-Host "Processing data..."
# your code here
}
New-Step 'Upload Results' {
Write-Host "Uploading results..."
# your code here
}
Stop-Stepper # removes the state file on successful completionIf the script fails inside a New-Step block, the next run resumes at the step that failed. All previously completed steps are skipped!
On first run, Stepper checks for [CmdletBinding()] and the self-install guard independently — each is silently injected if missing (the guard is wrapped in #region Stepper ignore so it won't trigger unmanaged-code warnings), then Stepper exits and asks you to re-run. Nothing is required beyond what's shown above.
Stepper also logs every step — execution timing, host output, and a per-step transcript — to <scriptname>.ps1.stepper.log by default. No configuration required.
Test.ps1.mp4
- How It Works — execution lifecycle, resume logic, verbose output, non-interactive mode
- Named Steps — step names,
$Stepper.StepName, resume prompt formats - Data Persistence —
$Stepperhashtable, state file schema - Logging — log files, step transcripts,
-LogPath,-NoLog - Unmanaged Code — detection,
#region Stepper ignore, interactive resolution - API Reference —
New-Step,Stop-Stepper, error handling - Examples
- Troubleshooting
MIT License w/Commons Clause - see LICENSE file for details.
Made with 💜 by Jake Hildreth
