Repository navigation
fix(installer): resolve the profile through PowerShell - #14
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ask PowerShell for
$PROFILE.CurrentUserCurrentHostinstead of guessing the Documents folder and PowerShell edition. This fixes profile installation when Windows redirects Documents.Prefer
pwsh.exe, withpowershell.exeas the fallback only whenpwsh.exeis unavailable. PreservePSTACK_PROFILE_PATHand 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
CONTRIBUTING.mdVerification
node --test scripts\install-always-on.test.mjspassed all 41 cases. The tests-first commit produces5 failingagainst the original installer.node scripts\install-always-on.mjs --dry-run --skip-trustpassed. 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, andnode --test scripts\check-copilot-port.test.mjs scripts\check-upstream-sync.test.mjsall passed.