Skip to content

WIP-Path Update for Package installation #390

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

Closed

Conversation

theJasonHelmick
Copy link
Contributor

@theJasonHelmick theJasonHelmick commented Apr 30, 2025

On Windows, when a user installs a tool using a package manager like WinGet or Chocolatey in
PowerShell, the tool is often added to the system or user PATH environment variable. However,
changes to PATH made during the installation process are not automatically propagated to running
PowerShell sessions or other active console applications. As a result, users frequently need to
start a new PowerShell session to recognize and use the newly installed command-line tools.

This behavior can be confusing and disrupts the workflow—especially in automation scenarios or when
users expect tools to be immediately available post-installation. Addressing this limitation would
improve usability, align with user expectations, and reduce friction in both interactive and
scripted environments.

@iSazonov
Copy link
Contributor

Why not just read the environment variables from the registry before launching a native application?
PowerShell executes a lot of code to run a native application so reading two keys of the registry will be unnoticeable in time.
This will address any changes to the environment variables (although we can limit ourselves to PATH only).
Example from Chocolatey

@theJasonHelmick theJasonHelmick changed the title Path Update for Package installation WIP-Path Update for Package installation Apr 30, 2025
@daxian-dbw
Copy link
Member

Superseded by #391

@daxian-dbw daxian-dbw closed this Apr 30, 2025
@daxian-dbw
Copy link
Member

@iSazonov There are scenarios where the process-scope PATH is intentionally altered to restrict what PowerShell can discover for native commands.

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.

3 participants