Skip to content
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

Winget List - add machine-parseable output #3051

Closed
apcsb opened this issue Mar 6, 2023 · 4 comments
Closed

Winget List - add machine-parseable output #3051

apcsb opened this issue Mar 6, 2023 · 4 comments
Labels
Issue-Feature This is a feature request for the Windows Package Manager client. Resolution-Duplicate Issue is a duplicate
Milestone

Comments

@apcsb
Copy link

apcsb commented Mar 6, 2023

Description of the new feature / enhancement

#1155
Winget List is useful for scripting to check if a package is present, but current output is human-oriented.
I often need to check if a specific package version is installed, or what version of a specific package is installed.
Currently I have to parse text output, which is not fun, given the variable column names/widths etc.

Proposal: Add an option to display the results as CSV/JSON/XML/anything else machine readable vs human-readable for scripting. This is in addition to what export offers. Export currently dumps a lot, requires a file and takes a lot of time. This should run quickly (a single package and dump to stdout (for capture/redirection).

Proposed technical implementation details

winget list <query> --out-json
returns a JSON object into stdout (for redirection / capture)

Optionally --out-csv, --out-xml etc.

@apcsb apcsb added the Issue-Feature This is a feature request for the Windows Package Manager client. label Mar 6, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Mar 6, 2023
@stephengillie
Copy link

This would be very useful for projects like:

@stephengillie stephengillie removed the Needs-Triage Issue need to be triaged label Mar 7, 2023
@Trenly
Copy link
Contributor

Trenly commented Mar 7, 2023

Have you tried using the PowerShell Cmdlets? They should provide the output as a PowerShell object which can be used natively or converted to a structured format like JSON

@denelon
Copy link
Contributor

denelon commented Mar 8, 2023

Duplicate of #1753

@denelon denelon marked this as a duplicate of #1753 Mar 8, 2023
@microsoft-github-policy-service
Copy link
Contributor

@apcsb we've identified this Issue as a duplicate of another one that already exists. This specific instance is being closed in favor of tracking the concern over on the referenced Issue. Thanks for your report! Be sure to add your 👍 to the other issue to help raise the priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature This is a feature request for the Windows Package Manager client. Resolution-Duplicate Issue is a duplicate
Projects
None yet
Development

No branches or pull requests

4 participants