Execute a script at boot up and install winget packages

Jonas Bauer 26 Reputation points
2023-02-08T21:18:08.07+00:00

Hello all,

In my private system I started to use Winget. Which has convinced me with the simple Installierne of various programs.

Now my idea was to use this now also in our It infrastructure, instead of the current classic way msi upload and install at the client.

Because here the main problem was to get all msi files.

As I learned, scripts run at start up with admin rights, which are also needed to install winget programs.

I wrote a powershell script which should install everything.

winget install --id "Microsoft.PowerToys" --version 0.66.0 --source winget --accept-package-agreements --silent
winget install --id "Mozilla.Firefox" --version 109.0 --source winget --accept-package-agreements --silent
winget install --id "7zip.7zip" --version 22.01 --source winget --accept-package-agreements --silent
winget install --id "BlenderFoundation.Blender" --version 3.4.1 --source winget --accept-package-agreements --silent
winget install --id "Inkscape.Inkscape" --version 1.2.1 --source winget --accept-package-agreements --silent
winget install --id "VideoLAN.VL" --version 3.0.18 --source winget --accept-package-agreements --silent
winget install --id "SSHFS-Win.SSHFS-Win" --version 3.5.20357 --source winget --accept-package-agreements --silent
winget install --id "WinFsp.WinFsp" --version 1.12 --source winget --accept-package-agreements --silent
winget install --id "NoMachine.NoMachine" --version 8.2.3 --source winget --accept-package-agreements --silent

I added it into the Group Policies at start up via Powershell scripts, that should be fine.

The script is executed according to GroupPolicy results but the programs are not installed.

Therefore the question, what am I doing wrong, because unfortunately I can't find much about this on the internet. How to manage Winget by Group Policies.

With kind regards

Windows for business Windows Client for IT Pros Directory services Active Directory
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. gabriel guardiola 5 Reputation points
    2023-02-19T15:11:49.53+00:00

    Hello Jonas

    as i'm looking for the same thing as you, have at reboot a check to install/upgrade some apps on the user pc.

    i found this article https://call4cloud.nl/2021/05/cloudy-with-a-chance-of-winget/

    on chapter 3 of this article it say : "Winget command is normally not recognized in the system context".

    if that's true, it mean i can't do the upgrade of Teams in wide machine install scenario (hvd scenario).

    The article was written in may 2021, so maybe the latest version of winget may differ.

    regards

    Gab

    1 person found this answer helpful.
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.