Repair Winget with PowerShell

How to deploy the Winget Pre-Install as a script

We have found that even though we are checking for the Winget installation via the Winget Pre-Install dependency that sometimes devices are still having issues installing applications. After further investigation we have found that sometimes Winget is detected as being installed but it might be corrupt or run into issues when installing applications. Manually deploying our Pre-Install seems to fix these issues as it completely reinstalls Winget and all it's dependencies, even if Winget already exists on the device.

Steps to deploy script from Intune

  1. Go to https://github.com/pckgrapp/pckgr to access the Winget Install script

  2. Download the WingetInstall.ps1 script as a ZIP folder

  3. Unzip the Folder and extract the WingetInstall.ps1 file

  4. Log into Microsoft Endpoint Manager

  5. Go to Devices -> Scripts -> Add a new Script for Windows 10 and later

  6. Call the Script "Winget Install"

  7. Upload the previously extracted PowerShell script

  8. Change "Run script in 64 bit PowerShell Host" to Yes and click next

  9. Assign a group to the script, this could be the following:

    1. Target specific user with issue

    2. Target specific device with issue

    3. Target all devices or users

  10. Wait for the script to deploy to the device

  11. Test installing the problem app to see if the issue is resolved

Last updated