chocolatey / chocolatey/choco

Install-ChocolateyPath: should -Scope default to 'Machine'

Open
#3,448 0 comments 0 reactions 0 assignees View on GitHub
0 - Triaging Breaking Change Enhancement
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [X] I have verified this is the correct repository for opening this issue.
- [X] I have verified no other issues exist related to my request.

### Is Your Feature Request Related To A Problem? Please describe.

Packages that don't specify a `-Scope` for `Install-ChocolateyPath` will default to `User` scope, even if choco is running as admin (which is our primary supported use case).

### Describe The Solution. Why is it needed?

Packages installing software system-wide (as is our often expected use case) may wind up putting values in the _user_ PATH instead if the package maintainers aren't sufficiently aware / heeding documentation on what the defaults are. This could potentially result in packages not working as expected in a multi-user system, and is reasonably non-trivial to see where the fault might lie.

Some options:

- Since choco's expected use case is admin/elevated installations, we should default to Machine all the time
- We could make the default dependent on whether choco is running as admin? if in non admin, default to User scope, otherwise default to Machine
- No change, keep it defaulting to User scope
- Make it a mandatory parameter so maintainers _have_ to specify the scope when using Install/Uninstall-ChocolateyPath in their packages.

### Additional Context

_No response_

### Related Issues

_No response_

Contributor guide

Open the contributing guide

Research direction

Review the current default behavior of Install-ChocolateyPath and compare it with the four alternatives described in the issue. A completed change would establish and document one clear scope policy, including behavior for elevated and non-elevated installations, with coverage for the selected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.