I'm trying to understand how the new PowerShell commands work #2506
WillPittenger
started this conversation in
PowerShell
Replies: 3 comments
-
I'll circle back with the engineering team on this. The original cmdlets were part of a hackathon and were just wrapping the .exe. The latest cmdlets were designed to work with the COM API so there might be some differences between the original intent and what was built most recently. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I also couldn't find the source for |
Beta Was this translation helpful? Give feedback.
0 replies
-
Could there be a problem with a recent checkin? Some form of versionitis? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was looking at the source for the new PowerShell wrapper for winget. But I wasn't seeing some of the code. I couldn't find classes like
MatchResult
or enums likeCompositeSearchBehavior
. I couldn't find their declarations even in the C++ code.I'm also puzzled why the commands, when they return something, return
object
rather than something like the previously mentionedMatchResult
. I was envisioning issuing something like(Find-WinGetPackage Microsoft.PowerToys).Install()
. If a dedicated class were used, you could only download a bare minimum amount of data. Downloading something like*
(all packages) can take a while if you download all fields. Instead, you download only a few key fields. Then you expose a member method likeExpand()
which obtains the remaining fields.Next, what's the equivalent of
winget upgrade
? (without the package name') JustUpdate-WinGetPackages
doesn't seem to do anything. I don't see how to turn on interactive mode for the installer either.Finally, what's the difference between
Get-WinGetPackage
andGet-WinGetPackageInfo
?Beta Was this translation helpful? Give feedback.
All reactions