Skip to content

[release/v7.6.10] Use GetCurrentPackageFamilyNameNative API instead of path matching to detect MSIX installation - #28313

Open
Dongbo Wang (daxian-dbw) wants to merge 1 commit into
PowerShell:release/v7.6.10from
daxian-dbw:backport/release/v7.6.10/28029-29a743d40
Open

Dongbo Wang (daxian-dbw) wants to merge 1 commit into
PowerShell:release/v7.6.10from
daxian-dbw:backport/release/v7.6.10/28029-29a743d40

Conversation

@daxian-dbw

Copy link
Copy Markdown
Member

Backport of #28029 to release/v7.6.10

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

Improves handling of the customer-reported MSIX/PATH issue discussed in #27782. Uses native package identity detection instead of installation-path matching to select the stable execution-alias directory, and compares Windows process names case-insensitively so mixed-case launch paths are handled correctly.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

The original PR reports validation with the MSIX bundle produced by its build. Backport commit ce96a4c cherry-picked without conflicts and the working tree is clean. Local tests were not run; backport CI must pass before merge.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Changes startup PATH handling and adds Windows native interop. Changes are scoped to installation detection and Windows process-name comparison; the prerequisite MSIX PATH fix is already backported.

@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 Nov 3, 2026
Copilot AI balanced review requested due to automatic review settings November 3, 2026 22:58
@azure-pipelines

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The Windows startup PATH backport lacks release-branch validation of MSIX execution-alias resolution, unpackaged startup, and unavailable-native-API fallback; documented upstream testing does not establish those runtime results.

No open issues 🎉

What changed in this PR

Backports #28029 to release/v7.6.10, refining the existing MSIX startup PATH fix by detecting package identity through a Windows API rather than installation-path matching.

Changes:

  • Adds native package-family lookup with cached installation detection.
  • Uses the package family name to select the stable execution-alias directory for PATH.
  • Makes Windows executable-name comparisons case-insensitive while preserving Unix behavior.
File Description
src/​System.Management.Automation/​engine/​Utils.cs Caches MSIX identity detection and the package family name.
src/​System.Management.Automation/​engine/​Interop/​Windows/​GetCurrentPackageFamilyName.cs Adds a native package-family lookup wrapper.
src/​Microsoft.PowerShell.ConsoleHost/​host/​msh/​ConsoleHost.cs Replaces path-based detection and handles mixed-case Windows executable names.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants