Winget is nothing more than a simple a way to get and install packages (any software with an installer) and to upgrade packages that are on your machine, regardless of how they were first installed. So, it can easily upgrade packages installed with winget, with Chocolatey, with MS Store, or directly using an MSI.
But winget does not keep any type of record on your machine when it installs or upgrades a package. Even trying to compare and combine output from choco list
and the Registry Uninstall folder, there's no connection to winget.
My solution: Create a winget wrapper
Create a thin PowerShell wrapper of the winget command ((command winget).source
) that maintains its own local catalog of packages it installed or uninstalled over time.
You can even point to the wrapper.ps1 by defining your own winget
alias to override the winget command.
Simple and effective. You just need to remember to use that on new machines before starting your setup.
Alternative: Get-Installed
Unless you only ever install packages with winget, then even such a catalog may not be a complete picture of what's on your system. If you want to duplicate another machine (without creating a cloned image) then you need to include choco, msi, MS Store, and possibly other installers.
There is a Get-Installed PowerShell script that scans the Registry Uninstall folders (both 32 and 64 bit) and optionally apps installed by MS Store and generates a report.
I've used this many times in the past to accomplish what the OP wanted to do!