Add -o/--output-format options for search/show/list to output CSV|JSON and possibly other formats easy to consume by PowerShell #2595
Labels
Issue-Feature
This is a feature request for the Windows Package Manager client.
Resolution-Duplicate
Issue is a duplicate
Milestone
Description of the new feature / enhancement
Right now it is really hard to convert the output of commands like
winget list
in PowerShell. Simply trying to sort the output gives corrupted characters in the output e.g.Results in:
Even if the corrupted chars were fixed, there is rich data in the output that has to be parsed out by PowerShell - what Jeffrey Snover would call "prayer-based parsing". There is a better way that would benefit not just PowerShell.
Related to #221
Proposed technical implementation details
Implement a new parameter to commands that output rich information e.g. search, show and list (and maybe others). I propose using
-o | --output-format
. The default output format would beTable
, to match the current output format. But I would like to see a CSV option that could be used to open the output in Excel or used by PowerShell like so:Furthermore, you could also support a
List
format that would not truncate text e.g.:The text was updated successfully, but these errors were encountered: