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

JSON Formatted Output Support #184

Open
RichiCoder1 opened this issue May 19, 2020 · 16 comments
Open

JSON Formatted Output Support #184

RichiCoder1 opened this issue May 19, 2020 · 16 comments
Labels
Issue-Feature This is a feature request for the Windows Package Manager client.

Comments

@RichiCoder1
Copy link

Description of the new feature/enhancement

To enable automation and consumption via other tools, it'd be great if current and future commands supported a JSON output mode.

@RichiCoder1 RichiCoder1 added the Issue-Feature This is a feature request for the Windows Package Manager client. label May 19, 2020
@denelon denelon added this to the Package Manager Backlog milestone May 23, 2020
@mikemaccana
Copy link

mikemaccana commented May 23, 2020

Modern Windows command line apps are in powershell, and already output structured objects. These can already be converted to JSON, Excel, CSV, or whatever other format is preferred.

The issue is that winget is unique, in that it doesn't output any structured data. #196 was created to address this issue but it was closed.

@RichiCoder1
Copy link
Author

@mikemaccana As mentioned on the other two issues, PowerShell isn't available in all Windows SKUs which this is targeting. For native PowerShell support, you're looking for #221.

@megamorf
Copy link

@RichiCoder1 Could you list all target SKUs and/or a link to the requirements spec, please?

@RichiCoder1
Copy link
Author

It's been mentioned multiple times across multiple sources:

@denelon
Copy link
Contributor

denelon commented Aug 6, 2021

@RichiCoder1 I'm going through the backlog as a part of our planning exercise for the next few milestones. I'm going to close this as a Duplicate of #221.

@ghost
Copy link

ghost commented Aug 6, 2021

@RichiCoder1 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.

@ghost ghost closed this as completed Aug 6, 2021
@ghost ghost added the Resolution-Duplicate Issue is a duplicate label Aug 6, 2021
@RichiCoder1
Copy link
Author

I'm cool with that as long as the ultimate functionality is still flexible enough to be consumed from other tools

@denelon
Copy link
Contributor

denelon commented Aug 6, 2021

Yes, that is the intent. Rather than building some kind of --output-JSON flag, the native PowerShell implementation will provide objects that may be used, and will not have the truncated output string behavior currently exhibited in the winget.exe client.

@mikemaccana
Copy link

mikemaccana commented Aug 6, 2021 via email

@denelon denelon modified the milestones: Backlog-Client, v1.2 Client, v1.1-Client Oct 1, 2021
@stknohg
Copy link

stknohg commented Oct 28, 2021

@denelon PowerShell isn't the only Windows shell.
For example, I also use nushell, some users use git bash, and some users still use the command prompt.

I strongly hope to implement the json output parameter (like --output-JSON).

@mikemaccana
Copy link

mikemaccana commented Oct 28, 2021 via email

@stknohg
Copy link

stknohg commented Oct 28, 2021

I think It feels very wasteful to call powershel.exe or pwsh.exe every time I use winget on non-PowerShell shell.

@denelon
Copy link
Contributor

denelon commented Mar 27, 2024

I'm going to re-open this issue. It's not high-priority (unless we see a lot of 👍) since we have the option in PowerShell, but I can see value in what is being asked for.

We still have more work to completely move everything the CLI is calling into the COM APIs, and once that's done, providing some kind of output type/format "should" be a bit easier to implement.

@denelon denelon reopened this Mar 27, 2024
@Banthaf0dder
Copy link

I'm going to re-open this issue. It's not high-priority (unless we see a lot of 👍) since we have the option in PowerShell, but I can see value in what is being asked for.

We still have more work to completely move everything the CLI is calling into the COM APIs, and once that's done, providing some kind of output type/format "should" be a bit easier to implement.

I'd like to note one thing in reference to powershell. Until the winget powershell module can be used in system context there is a gap in functionality that could be filled if winget output could be json formatted. That would make converting winget output to a powershell object very easy.

@sam-bryant
Copy link

Can we get an update on this? It would be a very beneficial feature to output structured data like most other modern cli's.

@denelon
Copy link
Contributor

denelon commented Dec 17, 2024

Hey everyone, we've been publishing the Microsoft.WinGet.Client PowerShell module for the last several months with each WinGet release. It now works on Windows PowerShell and it works in system context (depending on the installer one is trying to use, and the scope is "System").

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.
Projects
None yet
Development

No branches or pull requests

7 participants