-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Brief description of your issue
There seems to be a lack of clear and defined documentation regarding the proper deployment and bootstrapping of WinGet using PowerShell on new machines. The main issue lies with the latest Windows 10/11 ISOs that Microsoft currently ships to manufacturers; WinGet doesn't work out-of-the-box on new deployments using those images and errors out. This is due to the version of the App Installer MSIX package shipping with those ISOs being outdated and not functioning as expected. See issue:
I've been using a PowerShell script of my own to bootstrap/repair WinGet utilizing the Microsoft.WinGet.Client module on new deployments. It seems to work well enough, but I would still prefer clear guidance on whether this is best practice or not.
This is the distilled version of the deployment script I use to repair and bootstrap WinGet.
#Requires -RunAsAdministrator
# Install NuGet package provider to install Microsoft.WinGet.Client module
Install-PackageProvider -Name NuGet -Force
# Install Microsoft.WinGet.Client module
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force
# Repair WinGet package manager
Repair-WinGetPackageManager -Latest