chocolatey / chocolatey/choco

Fast method for checking if a version of a package is installed.

Open
#1,226 20 comments 4 reactions 0 assignees View on GitHub
0 - Backlog Enhancement Priority - Low Up For Grabs
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

Hi there,

Please let me know if I am missing something but i am using the following powershell to check to see if a package is installed or not.

```
choco list -lo | Where-object { $_.ToLower().StartsWith("SomeName".ToLower()) }
if($result -ne $null){
$parts = $result.Split(' ');
return $parts[1] -eq $this.Version;
}
return $false;
```

However "choco list -lo" is taking 2-3 seconds to give me a list of about 5 installed packages.

This is quite a long time if I want to check many packages on many servers and I am not sure why it needs to take so long. Is it possible to add a better function for checking if a particular version of a package is installed that returns in less that 50ms?

Cheers.

Contributor guide

Open the contributing guide

Research direction

The issue names the PowerShell `choco list -lo` path but no source file or test entry point. Begin by tracing that command and measuring its current 2–3 second behavior; done means a supported package/version check that meets the requested under-50ms target across many servers, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.