Skip to content

jakehildreth/Stepper

Repository files navigation

The Stepper logo features the word Stepper in a bold, stylized font with a set of stairs ascending diagonally to the right. The design conveys a sense of progress and upward movement, aligning with the tool's purpose of step-by-step automation. The background is plain, ensuring the logo remains the focal point. Font used: https://www.dafont.com/pix.font?fpp=200

Stepper

A cross-platform PowerShell utility module for creating resumable, step-by-step scripts with automatic state persistence.

PowerShell 5.1+ Platform PSGallery License


Quick Start

Install-Module -Name Stepper -Scope CurrentUser -Force

Scaffold a new script (or create one manually):

New-StepperScript -Name 'MyScript'

Or create a .ps1 script with New-Step blocks by hand:

[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 completion

If 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 component 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's execution timing, host output, and a per-step transcript to <scriptname>.ps1.stepper.log by default. No configuration required.


Demo

Test.ps1.mp4

Created with VHS by Charm.


Learn More

  • How It Works: execution lifecycle, resume logic, verbose output, non-interactive mode
  • Named Steps: step names, $Stepper.StepName, resume prompt formats
  • Data Persistence: $Stepper hashtable, state file schema
  • Logging: log files, step transcripts, -LogPath, -NoLog
  • Unmanaged Code: detection, #region Stepper ignore, interactive resolution
  • API Reference: New-Step, Stop-Stepper, New-StepperScript, Test-StepperScript, Repair-StepperScript, ConvertTo-StepperScript
  • Examples
  • Troubleshooting

License

MIT License w/Commons Clause - see LICENSE file for details.


Made with 💜 by Jake Hildreth

About

Stepper is a cross-platform PowerShell utility module for creating resumable, step-by-step scripts with automatic state persistence.

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors