Skip to content

Update PATH envrionment variable for package manager executable on Windows #25847

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daxian-dbw
Copy link
Member

PR Summary

Implementation for PowerShell/PowerShell-RFC#391. For the PS team members, here is the internal PR for the equivalent change in CMD: https://microsoft.visualstudio.com/OS/_git/os.2020/pullrequest/10131240

A few implementation decisions:

  1. Check the package manager list only once per process (same as CMD). So, changing the package manager list in registry doesn't affect a PowerShell session that is already running.

  2. When detecting user/system PATH value changes, only check new items PREPENDED or APPENDED to the original string (same as CMD). The detection is made simple, which is not intended to detect complex changes to the user/system PATH.

  3. The PATH update feature is disabled when the Environment provider is not available. The Environment provider is checked only once per PowerShell session (s_environmentProviderEnabled is thread static).

TODO

No test is added yet. Need help to brainstorm the best way to add test automation.

PR Checklist

@daxian-dbw daxian-dbw added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Aug 11, 2025
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.

1 participant