GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [release/v7.6.7] Handle MSIX installation specially when prepend to PATH by daxian-dbw · Pull Request #28091 · PowerShell/PowerShell

Conversation

@daxian-dbw

@daxian-dbw Dongbo Wang (daxian-dbw) commented Sep 24, 2026

Copy link
Copy Markdown
Member

Backport of #27782 to release/v7.6.7

Triggered by Dongbo Wang (@daxian-dbw) on behalf of Dongbo Wang (@daxian-dbw)

Original CL Label: CL-General

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Customer Impact

  • Customer reported
  • Found internally

Fixes an issue where, on MSIX-packaged PowerShell installations, the $PSHOME directory (which contains a version number) was prepended to PATH at startup. Because this path changes on every MSIX update, cached references to it (e.g., by cmake) become invalid after an update. The fix uses the stable ExecutionAlias directory instead.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Original PR was manually tested against MSIX-packaged PowerShell installations, verifying that the ExecutionAlias directory is prepended to PATH instead of the version-specific $PSHOME path, and that this remains stable across MSIX package updates. Backport verified by confirming the cherry-pick applied cleanly with no conflicts on release/v7.6.7.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Medium risk: changes core startup logic that modifies the PATH environment variable, but the change is narrowly scoped to MSIX installation detection and doesn't affect non-MSIX installations. The fix addresses a real reliability issue where PATH entries become invalid after an MSIX update.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@daxian-dbw
Handle MSIX installation specially when prepend to PATH (PowerShell#2…
6b1497e
…7782)

Update the code that prepends `$PSHOME` to `PATH` to handle the MSIX package installation specially -- it uses the stable path that points to the `ExecutionAlias` of the MSIX installation instead of `$PSHOME`.
Copilot AI lite review requested due to automatic review settings September 24, 2026 18:26
@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 24, 2026
@azure-pipelines

azure-pipelines Bot commented Sep 24, 2026

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot started reviewing on behalf of Dongbo Wang (daxian-dbw) September 24, 2026 18:27
View session
Copilot AI reviewed Sep 24, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved MSIX detection issues and insufficient, duplicated test coverage must be addressed.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
  • Medium severity Use case-insensitive comparison for Windows process names · New
  • Medium severity Assert PATH uses the stable MSIX execution-alias path · New
What changed in this PR

Backports the MSIX PATH handling fix so PowerShell uses a stable execution-alias directory instead of the versioned package path.

Changes:

  • Adds executable-home and MSIX alias resolution.
  • Updates startup PATH behavior.
  • Adjusts pwsh PATH test coverage.
File Review summary
test/​powershell/​Host/​ConsoleHost.Tests.ps1 Moderate findings (2 votes): the assertion does not distinguish the old behavior and should verify the stable MSIX alias path. Nit (1 vote): the assertion duplicates existing coverage.
src/​Microsoft.PowerShell.ConsoleHost/​host/​msh/​ConsoleHost.cs Moderate findings: use case-insensitive process-name comparison (2 votes); derive MSIX identity rather than limiting support to official package constants (1 vote); support MSIX installations on non-default volumes (1 vote).

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
string processName = Path.GetFileName(psExePath);

// Use 'Environment.ProcessPath' if it points to 'pwsh.exe' or 'pwsh'.
if (pwshName.Equals(processName, StringComparison.Ordinal))
Comment thread test/powershell/Host/ConsoleHost.Tests.ps1
It "`$PSHOME should be in front so that pwsh.exe starts current running PowerShell" {
& $powershell -v | Should -Match $PSVersionTable.GitCommitId
It "Running 'pwsh' should start the currently running PowerShell" {
pwsh -v | Should -Match $PSVersionTable.GitCommitId
adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Sep 24, 2026
View reviewed changes
@daxian-dbw Dongbo Wang (daxian-dbw) added CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log and removed CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels Sep 24, 2026
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit df0dc57 into PowerShell:release/v7.6.7 Sep 24, 2026
36 of 39 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the backport/release/v7.6.7/27782-d0f43b003 branch September 24, 2026 21:59
@daxian-dbw Dongbo Wang (daxian-dbw) mentioned this pull request Sep 25, 2026
[release/v7.6.7] Fix the PATH test for MSIX installed PowerShell #28108
Merged
3 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@daxian-dbw @adityapatwardhan
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.