Status: Done (2026-02-20)
Priority: Medium
Component: tools/pslib/wsl/wsl-manager.ps1
Blocks: REFACT-003
Description:
Added optional -Username and -Password parameters to Invoke-SetupUser. Moved the Test-RunningInCIorTestEnvironment guard to wrap only the prompting block, so programmatic calls with explicit parameters work even under Pester. Invoke-WslManager passes both params through for the "setup-user" command.
Acceptance Criteria:
-
Invoke-SetupUser -DistroName "debian-test" -Username "testuser" -Password "pass"callsNew-WslUserwithout prompting, even under Pester -
Invoke-WslManager -Command "setup-user" -Name "debian-test" -Username "testuser" -Password "pass"passes both params through - When
-Username/-Passwordare omitted, interactive behaviour is unchanged - CI guard fires when prompting is needed but is bypassed when both params are provided
- Unit tests cover both non-interactive and interactive paths
- All existing tests continue to pass