I'm trying to figure out how to efficiently run Winget commands for upgrading software. I usually use the command `winget upgrade --all` to upgrade all my packages, and I typically run it as an admin. However, I've noticed that some software requires upgrades as a user, and attempting to upgrade them as an admin often fails. The downside to running it as a user is that I end up having to accept UAC prompts for every privileged install, which is really frustrating. Is there a better way to use Winget for upgrades without all the hassle?
3 Answers
You might want to consider running the command as part of a logon script in the user context like this: `winget upgrade --all --scope user`. This way, it'll only upgrade apps that are in the user's context. Don't forget, you can also keep running the command in the admin context with `winget upgrade --all --scope machine` daily to cover those applications too.
That doesn't exactly answer the original question, though. It seems like OP really wants a way to run Winget as admin effectively. They might want to Google 'run winget system context Intune' to find more specific solutions.
Honestly, right now I don't think Winget is fully ready for everyone. A lot of people still rely on other solutions that are more established. But you could check out user comments like the one from Adam Kearn for some insights.
I'm a fan of Winget! It's not as powerful as apt-get but definitely great for upgrades. You can use `winget upgrade --all --include-unknown`. Just keep in mind that on enterprise systems it might try to update applications like Office or Teams that have their own update processes, and those updates could fail.
Totally agree about the `--include-unknown` flag! For deploying installations and upgrades through automation, I like using this combination: `winget upgrade --all --include-unknown --accept-package-agreements --accept-source-agreements --silent --force`. This handles agreements automatically, updates everything possible, keeps it silent, and forces through conflicts.
Great tips! I think combining those parameters is a solid approach, but always be on the lookout for better solutions. It’s a learning process for all of us!

For more efficient management, try using Intune detections and remediations with Winget. You can set up a detection script to check for necessary components and a remediation script to handle the upgrades seamlessly every two weeks.