Skip to content

fix(installer): resolve the profile through PowerShell - #14

Merged
doublexmax merged 3 commits into
mainfrom
doublexmax-hook-deployment-reliability
Nov 3, 2026
Merged

doublexmax merged 3 commits into
mainfrom
doublexmax-hook-deployment-reliability

Conversation

@doublexmax

Copy link
Copy Markdown
Owner

Summary

Ask PowerShell for $PROFILE.CurrentUserCurrentHost instead of guessing the Documents folder and PowerShell edition. This fixes profile installation when Windows redirects Documents.

Prefer pwsh.exe, with powershell.exe as the fallback only when pwsh.exe is unavailable. Preserve PSTACK_PROFILE_PATH and the existing profile scope. Discovery errors stop installation before any writes.

Add isolated CLI regression tests and document shell selection. This targets one edition and does not migrate or delete blocks left at previously guessed locations.

Related issue

Closes #11.

Checklist

  • I read CONTRIBUTING.md
  • Docs/skills updated if behavior changed
  • Changes were tested/verified where applicable

Verification

  • node --test scripts\install-always-on.test.mjs passed all 41 cases. The tests-first commit produces 5 failing against the original installer.
  • node scripts\install-always-on.mjs --dry-run --skip-trust passed. Its target matches the native Windows PowerShell 5.1 profile under redirected Documents. PowerShell 7 selection is covered with mocked subprocess responses, not a local PowerShell 7 installation. No real profile was modified.
  • node scripts\check-copilot-port.mjs, node scripts\check-upstream-sync.mjs, and node --test scripts\check-copilot-port.test.mjs scripts\check-upstream-sync.test.mjs all passed.

doublexmax and others added 3 commits November 3, 2026 09:00
Exercise redirected profiles, shell selection, and discovery failures through the installer CLI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve the profile through PowerShell before installation writes. Prefer pwsh.exe and use Windows PowerShell only when pwsh.exe is unavailable. Preserve explicit profile overrides and report discovery failures instead of guessing paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@doublexmax
doublexmax merged commit 8a65e3a into main Nov 3, 2026
1 check passed
@doublexmax
doublexmax deleted the doublexmax-hook-deployment-reliability branch November 3, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Installer targets the wrong PowerShell profile when Documents is redirected

1 participant