Add winget repair helper and remove winget configure --enable prerequisite

Initialize-Winget.ps1 refreshes PATH, re-registers App Installer and
falls back to the provisioned package before exiting with a Store link.
All scripts that call winget now dot-source this helper instead of
failing on a missing winget.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 10:54:56 +02:00
parent 79ea61f445
commit 64352817f5
6 changed files with 84 additions and 26 deletions
+3 -4
View File
@@ -9,6 +9,8 @@ param(
$ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot "Initialize-Winget.ps1")
$IsAdministrator = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(
[Security.Principal.WindowsBuiltInRole]::Administrator
)
@@ -23,10 +25,7 @@ function Install-FirefoxEsr {
[string]$PackageId
)
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
Write-Error "winget was not found. Install App Installer or enable winget before running this script."
exit 1
}
Initialize-Winget
Write-Host "Installing Firefox ESR with winget: $PackageId" -ForegroundColor Cyan