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
Go to https://github.com/pckgrapp/pckgr to access the Winget Install script
Download the WingetInstall.ps1 script as a ZIP folder
Unzip the Folder and extract the WingetInstall.ps1 file
Log into Microsoft Endpoint Manager
Go to Devices -> Scripts -> Add a new Script for Windows 10 and later
Call the Script "Winget Install"
Upload the previously extracted PowerShell script
Change "Run script in 64 bit PowerShell Host" to Yes and click next
Assign a group to the script, this could be the following:
Target specific user with issue
Target specific device with issue
Target all devices or users
Wait for the script to deploy to the device
Test installing the problem app to see if the issue is resolved
Last updated