Skip to content

More package information in Exported JSON file #2030

Description

@turpie

Description of the new feature / enhancement

It would be helpful if the "winget export" command would include a verbose option to include the full package information, rather than just the PackageIdentifier (and version if --include-versions is used).

For example for Windows Terminal the exported JSON includes only PackageIdentifier and optionally the current installed Version:
"PackageIdentifier" : "Microsoft.WindowsTerminal",
"Version" : "1.11.3471.0"

Winget can produce more information from other commands. e.g. "winget list" adds the Name and Source
Windows Terminal Microsoft.WindowsTerminal 1.11.3471.0 winget

Searching winget list for a single package adds the Available version.

winget list --id Microsoft.WindowsTerminal
Name             Id                        Version     Available    Source
--------------------------------------------------------------------------
Windows Terminal Microsoft.WindowsTerminal 1.11.3471.0 1.12.10393.0 winget

and Winget show has a lot more information:

winget show --id Microsoft.WindowsTerminal
Found Windows Terminal [Microsoft.WindowsTerminal]
Version: 1.12.10393.0
Publisher: Microsoft
Publisher Url: https://www.microsoft.com/
Moniker: terminal
Description: The new Windows Terminal, a tabbed command line experience for Windows.
Homepage: https://docs.microsoft.com/windows/terminal/
License: MIT
License Url: https://github.com/microsoft/terminal/blob/master/LICENSE
Privacy Url: https://privacy.microsoft.com/
Installer:
  Type: msix
  Download Url: https://github.com/microsoft/terminal/releases/download/v1.12.10393.0/Microsoft.WindowsTerminal_1.12.10393.0_8wekyb3d8bbwe.msixbundle
  SHA256: 23daf0b5a5783d07322b9fee3eef98d45b8d11d4d77f9dbd75a0eb13069592f1

Why can't all of that information be included in the exported JSON file?

Proposed technical implementation details

The "winget export" should have a new flag such as --detailed or --verbose that includes all the available information for each package.
For example the Windows Terminal section of the JSON file would look like:

      {
         "PackageIdentifier": "Microsoft.WindowsTerminal",
         "InstalledVersion": "1.11.3471.0",
         "AvailableVersion": "1.12.10393.0",
         "Publisher": "Microsoft",
         "PublisherUrl": "https://www.microsoft.com/",
         "Moniker": "terminal",
         "Description": "The new Windows Terminal, a tabbed command line experience for Windows.",
         "Homepage": "https://docs.microsoft.com/windows/terminal/",
         "License": "MIT",
         "LicenseUrl": "https://github.com/microsoft/terminal/blob/master/LICENSE",
         "PrivacyUrl": "https://privacy.microsoft.com/",
         "InstallerType": "msix",
         "InstallerDownloadUrl": "https://github.com/microsoft/terminal/releases/download/v1.12.10393.0/Microsoft.WindowsTerminal_1.12.10393.0_8wekyb3d8bbwe.msixbundle",
         "InstallerSHA256": "23daf0b5a5783d07322b9fee3eef98d45b8d11d4d77f9dbd75a0eb13069592f1"
       },

Activity

  1. ghost added
    Needs-TriageIssue needs to be triaged
    on Mar 18, 2022
  2. denelon commented on Mar 18, 2022

    @denelon
    Collaborator

    Paul Turpie (@turpie),

    The export command is designed to produce a JSON file used by the import command. We've got features to add support for additional information for the import command. We're only exporting data we can consume to drive behavior for import today.

    We're looking to add support for things like flags and scope (user vs. machine) in the schema so import could leverage those behavior driving properties.

    What is the use case for exporting metadata that doesn't affect the import command?

  3. jedieaston commented on Mar 18, 2022

    @jedieaston
    Contributor

    I could see a use case where I would want to generate a manifest for a package without having to interact with the repository directly (via using the API if available or a git clone in the case of the community repo). Then if I wanted to reuse a manifest in my repository from the community repo it would be pretty easy to grab.

    For import, providing more of the manifest would allow attempting to install the package even if it is not available in any of the repositories for some reason (although, at least in the case of the official repos, the reason is usually good).

  4. oldshensheep commented on Jul 9, 2022

    @oldshensheep

    Sometimes I need to edit the exported file, but the "PackageIdentifier" is unreasonable if the source is from the msstore. Add more information like name is better for editing.

    "PackageIdentifier" : "9N0866FS04W8"
  5. kdpuvvadi commented on Sep 6, 2022

    @kdpuvvadi

    Any update on this?

  6. turpie commented on Sep 7, 2022

    @turpie
    Author

    What is the use case for exporting metadata that doesn't affect the import command?

    I was looking to write a powershell script to manage updates and some other automation of remote computers. I was hoping to work around the current lack of Powershell integration.

  7. Trenly commented on Jun 16, 2023

    @Trenly
    Contributor

    [Policy] Command-Export

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-ExportIssue related to WinGet ExportIssue-FeatureThis is a feature request for the Windows Package Manager client.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions