-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
support
#500
Comments
I looked at it and the parsing would currently be a bloody mess. The tool is currently only designed to be used interactively in a terminal. There are some issues already in discussion to allow machine-readable outputs, but until that the parsing is too complicated, because winget creates a table with dynamic-sized columns, which is even with sed etc. not too trivial. microsoft/winget-cli#221 I would put it on hold until winget offers a better experiance for parsing. |
Alright let's wait then |
Parsing table with variable columns is doable. Look for instance how other package managers does it:
I can try to implement a first version and we can collectively iterate on it. The thing is I do not have any Windows instance available at the moment. But if you provide me with terminal captures of some commands I can make an attempt. Does |
|
seems there is now official powershell support that supports custom output
however when looking at the repo, the list command doesn't seem to be in there
|
@hannesdelbeke Not sure precisely what you mean but I would expect a list action to correspond to the So, Does that help? |
yes it seems that Do you perhaps also know if there is an option to get machine readable output from |
Oh! Actually, what they did is very powershelly of them, I like it. :) PowerShell has a strongly encouraged (but ultimately. optional) set of approved verbs. You can also list them, along with definitions by executing
Yup, checked just now, and the winget team did good here as well. Another principle: "everything is an object". Because the cmdlet returns an object and not an array of strings, you can do cool stuff like convert it to JSON in a consistent fashion like you would with any other object: PS > Get-WinGetPackage python | ConvertTo-Json
[
{
"ID": "Miniconda3 py39_4.10.3 (Python 3.9.5 64-bit)",
"Version": "394.10.3",
"Source": ""
},
{
"ID": "Python.Python.3.10",
"Version": "3.10.9",
"Source": "winget"
},
{
"ID": "SomePythonThings.WingetUIStore",
"Version": "1.6.1",
"Source": "winget"
}
] As far as YAML goes, looks like there's a module for that. CSV is built-in like JSON, try |
Wow, thanks @hannesdelbeke and @halr9000 for keeping track of these new developments! I'm not a Windows user so I'm slow picking up new development. I'll try to take a look at it at one point, but if you think there's enough material to attempt an implementation, feel free to start a PR. Even if it's janky or hackish, it can serve as a good starting point to iterate on. At the moment I'm deep into refactoring and stabilizing the test suite of |
Ah, perfect, thanks @hannesdelbeke and @halr9000! I could do an implementation in the next days. |
@autinerd If you try an implementation go ahead! I'm not going to nitpick your code anyway, there lots of automatic fix implemented right now by the way of GitHub actions. |
WinGet has been implemented upstream. It will be available in the upcoming v5.16.0 release of Meta Package Manager. |
WinGet is a new native tool in Windows 11.
The text was updated successfully, but these errors were encountered: