Status: Done (2026-02-20)
Priority: Medium
Component: tools/pslib/wsl/wsl-manager.ps1
Blocks: REFACT-003
Description:
Invoke-UpdateDistro and Invoke-RemoveDistro had no parameters — they were purely interactive, always calling Read-Host. Added an optional -Selection parameter to both functions. When -Selection is provided, Read-Host is skipped; all other logic (list display, number/name resolution, validation) runs in both cases — single code path. Invoke-WslManager passes $Name as -Selection for the "update" and "remove" commands.
Acceptance Criteria:
-
Invoke-RemoveDistro -Selection "debian-test"removes without prompting -
Invoke-UpdateDistro -Selection "Debian"updates without prompting -
Invoke-WslManager -Command "remove" -Name "debian-test"passes$Nameas-Selection -
Invoke-WslManager -Command "update" -Name "Debian"passes$Nameas-Selection - When
-Selectionis omitted, interactive behaviour (Read-Host prompt) is unchanged - Unit tests cover both non-interactive (selection provided) and interactive paths
- All existing tests continue to pass