Skip to content

Fix #8264: detect pwsh in custom Scoop locations#20247

Open
Adesh4477 wants to merge 1 commit into
microsoft:mainfrom
Adesh4477:fix/issue-8264-pwsh-scoop-detection
Open

Fix #8264: detect pwsh in custom Scoop locations#20247
Adesh4477 wants to merge 1 commit into
microsoft:mainfrom
Adesh4477:fix/issue-8264-pwsh-scoop-detection

Conversation

@Adesh4477
Copy link
Copy Markdown

@Adesh4477 Adesh4477 commented May 20, 2026

Closes #8264

Terminal only checked %USERPROFILE%\scoop\shims for pwsh.exe, so
users who installed Scoop to a custom or global location is getting missed.
its looking in default location only.

Changes:

  • Add _getEnvironmentVariable() helper to safely read env vars.
  • Add PowerShellFlags::ScoopGlobal so global-scope installs get a distinct profile name (and GUID) from user-scope installs.
  • User-scope: custom %SCOOP% if set, else fall back to the default location no duplicates possible.
  • Global-scope: if %SCOOP_GLOBAL% is set, also add a separate "PowerShell (scoop global)" profile.

At most two Scoop profiles are produced (one user (custom/default), one global).

Verified manually by pointing both env vars at test directories
containing pwsh.exe and confirming the profiles appear in the
dropdown and getting launch successfully.

Summary of the Pull Request

References and Relevant Issues

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

@Adesh4477
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@github-actions

This comment has been minimized.

@microsoft-github-policy-service microsoft-github-policy-service Bot added Issue-Task It's a feature request, but it doesn't really need a major design. Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels May 20, 2026
Terminal only checked %USERPROFILE%\scoop\shims for pwsh.exe, so
 users who installed Scoop to a custom or global location is getting missed.
 its looking in default location only.

 Changes:

 - Add _getEnvironmentVariable() helper to safely read env vars.
 - Add PowerShellFlags::ScoopGlobal so global-scope installs get a
   distinct profile name (and GUID) from user-scope installs.
 - User-scope: custom  %SCOOP% if set, else fall back to the default
   location no duplicates possible.
 - Global-scope: if %SCOOP_GLOBAL% is set, also add a separate
   "PowerShell (scoop global)" profile.

 At most two Scoop profiles are produced (one user (custom/default), one global).

 Verified manually by pointing both env vars at test directories
 containing pwsh.exe and confirming the profiles appear in the
 dropdown and getting launch successfully.
@Adesh4477 Adesh4477 force-pushed the fix/issue-8264-pwsh-scoop-detection branch from 466185b to d932420 Compare May 20, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doesn't detect pwsh installed in custom directory from Scoop

2 participants