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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user