Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Extending Modules & Tools

Adding a Drop-In Pluggable Module (scripts/modules/*.ps1)

Any file matching scripts\modules\*.ps1 that does not start with _ and does not end with .disabled.ps1 is automatically loaded by scripts\catalog.ps1:

  1. Copy scripts\modules\_example.disabled.ps1 to e.g. scripts\modules\10_custom.ps1.
  2. Return a module hashtable with MenuKey, ModuleId, Name, Description, Optional, and Items.
  3. Each item supports Type = 'PowerShell' (Script = 'ps\your-domain.ps1'; Action = 'your-id'), Type = 'Batch' (Script = 'your-script.bat'), or Type = 'NativeExe' (Exe = '...'; Args = @()).
  4. Run WindowsUtilitiesMenu.bat --list to confirm automatic discovery.

Adding a New PowerShell 7 Action (scripts/ps/*.ps1)

  1. Dot-source scripts\ps\_ui-helpers.ps1 for consistent banners (Write-ActionBanner), confirmations (Confirm-WumAction), and pause handling (Wait-WumFinish).
  2. Accept -Action, -DryRun, and -NoPause, and exit 0 with [DRY-RUN] output immediately when $DryRun -or ($env:WUM_DRY_RUN -eq '1').
  3. Register the item in scripts\catalog.ps1 (or a pluggable module) with RequiresAdmin = $true if elevation is required — scripts\menu.ps1 handles UAC elevation automatically.

Adding a New Batch Utility Script (scripts/*.bat)

  1. Create scripts\<action-id>.bat with Windows CRLF line endings:
    • Call call "%~dp0_common.bat" require_admin "%~f0" if Administrator privileges are required.
    • Call call "%~dp0_common.bat" banner "Your Tool Title".
    • Honor if "%WUM_DRY_RUN%"=="1" immediately after the banner so --dry-run tests remain 100% safe.
    • Honor if not "%WUM_NO_PAUSE%"=="1" before trailing pause or timeout commands.
  2. Register the action in scripts\catalog.ps1 or a pluggable scripts\modules\*.ps1 module.
  3. Update README.md, README.txt, docs\user\cli-reference.md, and CHANGELOG.md under [Unreleased].