Skip to content

Enable Searching for Pwsh in the "Program Files (Arm)" directory on Windows Arm64 #5225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsmarvin
Copy link

PR Summary

  • Begin searching for Pwsh in the "Program Files (Arm)" directory on windows arm64.
    • Note this will only look for the "Program Files (Arm)" directory if the default "Program Files" directory does not contain a PowerShell install.
  • Add tests case documenting expected load order.
  • Update test cases to refer to v7 instead of v6.
    • I realize that this doesn't actually matter as its just looking for the first integer it finds, but since PS6 has been out of support for several years I thought it was time to update.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

…windows arm64

- Add tests case documenting expected load order
- Update test cases to refer to v7 instead of v6
@Copilot Copilot AI review requested due to automatic review settings June 29, 2025 12:07
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the PowerShell executable search logic on Windows Arm64 by including the "Program Files (Arm)" directory. Key changes include:

  • Adding an isArm64 flag in platform details.
  • Iterating over multiple possible Program Files paths (including "Program Files (Arm)").
  • Updating test cases to expect version 7 of PowerShell instead of version 6.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/core/platform.test.ts Updated test cases to include "Program Files (Arm)" and version updates.
src/platform.ts Added isArm64 property and modified the logic to try multiple Program Files paths.
Comments suppressed due to low confidence (1)

src/platform.ts:715

  • Update the method's documentation to reflect the new return type, noting that it returns an array of possible ProgramFiles paths instead of a single string.
    }: { useAlternateBitness?: boolean } = {}): (string | undefined)[] {

@@ -562,93 +564,96 @@ export class PowerShellExeFinder {
}: { useAlternateBitness?: boolean; findPreview?: boolean } = {}): Promise<
IPossiblePowerShellExe | undefined
> {
Copy link
Preview

Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

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

Consider adding a comment explaining the iteration over multiple ProgramFiles paths to clarify the search order and rationale.

Suggested change
> {
> {
// Iterate over possible `ProgramFiles` paths to locate PowerShell installations.
// This accounts for different system configurations, such as 32-bit and 64-bit installations,
// and ensures compatibility with alternate bitness settings if specified.

Copilot uses AI. Check for mistakes.

@tsmarvin
Copy link
Author

@microsoft-github-policy-service agree

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.

1 participant