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:
- Copy
scripts\modules\_example.disabled.ps1to e.g.scripts\modules\10_custom.ps1. - Return a module hashtable with
MenuKey,ModuleId,Name,Description,Optional, andItems. - Each item supports
Type = 'PowerShell'(Script = 'ps\your-domain.ps1'; Action = 'your-id'),Type = 'Batch'(Script = 'your-script.bat'), orType = 'NativeExe'(Exe = '...'; Args = @()). - Run
WindowsUtilitiesMenu.bat --listto confirm automatic discovery.
Adding a New PowerShell 7 Action (scripts/ps/*.ps1)
- Dot-source
scripts\ps\_ui-helpers.ps1for consistent banners (Write-ActionBanner), confirmations (Confirm-WumAction), and pause handling (Wait-WumFinish). - Accept
-Action,-DryRun, and-NoPause, and exit0with[DRY-RUN]output immediately when$DryRun -or ($env:WUM_DRY_RUN -eq '1'). - Register the item in
scripts\catalog.ps1(or a pluggable module) withRequiresAdmin = $trueif elevation is required —scripts\menu.ps1handles UAC elevation automatically.
Adding a New Batch Utility Script (scripts/*.bat)
- Create
scripts\<action-id>.batwith 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-runtests remain 100% safe. - Honor
if not "%WUM_NO_PAUSE%"=="1"before trailingpauseortimeoutcommands.
- Call
- Register the action in
scripts\catalog.ps1or a pluggablescripts\modules\*.ps1module. - Update
README.md,README.txt,docs\user\cli-reference.md, andCHANGELOG.mdunder[Unreleased].