Open turpie opened 2 years ago
@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?
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).
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"
Any update on this?
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.
[Policy] Command-Export
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.
and Winget show has a lot more information:
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: