chocolatey / chocolatey/choco

Don't check for admin privileges when running `choco upgrade all --noop`

Open
#2,062 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

I'm writing a powershell script to list currently installed vs latest versions of various pieces of software (standalone, managed by npm, managed by choco etc). I have a problem getting all this information from chocolatey. I use this:

`choco upgrade all --localonly --noop --yes --timeout 1 -r`

But when the script doesn't run with admin account this command hangs on user input for 20 seconds (the "you're not an admin, do you want to continue" prompt).

This causes a number of issues:
- Literally nothing else in my script requires admin account and neither should choco. I'm not even really upgrading anything and the command runs **just fine** without admin privileges. I **really** don't want to be forced to run my script with elevated privileges just for choco, and for no good reason.
- The admin privileges prompt cannot be overriden with --yes
- The timeout cannot be changed from the default 20 seconds
- This literally makes this command completely useless.

Is there a better way to achieve what I need to achieve, i.e. get a list of versions of all installed packages (`choco list --localonly`) and then for each package also get the latest version from choco catalog **without** stalling for 20 seconds or requiring an admin account? (`???`)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `choco upgrade all --localonly --noop --yes --timeout 1 -r` without administrator privileges and compare it with `choco list --localonly`. The issue names no source files or tests, so trace where the command prompts for elevation and verify that noop version discovery completes without the 20-second prompt or requiring an administrator account.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.