Files
winutil/docs/content/dev/features/Fixes/Winget.md
T

31 lines
834 B
Markdown
Raw Normal View History

2026-02-10 19:49:36 +00:00
---
title: "WinGet Reinstall"
description: ""
---
2026-02-18 12:37:09 -06:00
```powershell {filename="functions/public/Invoke-WPFFixesWinget.ps1",linenos=inline,linenostart=1}
2026-01-07 19:55:35 +00:00
function Invoke-WPFFixesWinget {
<#
.SYNOPSIS
2026-03-26 15:26:48 -05:00
Fixes WinGet by running `choco install winget`
2026-01-07 19:55:35 +00:00
.DESCRIPTION
2026-03-26 15:26:48 -05:00
BravoNorris for the fantastic idea of a button to reinstall WinGet
2026-01-07 19:55:35 +00:00
#>
# Install Choco if not already present
2026-01-14 20:28:45 +02:00
try {
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
2026-03-26 15:26:48 -05:00
Write-Host "==> Starting WinGet Repair"
2026-03-06 08:29:10 -06:00
Install-WinUtilWinget
2026-01-14 20:28:45 +02:00
} catch {
2026-03-26 15:26:48 -05:00
Write-Error "Failed to install WinGet: $_"
2026-01-14 20:28:45 +02:00
Set-WinUtilTaskbaritem -state "Error" -overlay "warning"
} finally {
2026-03-26 15:26:48 -05:00
Write-Host "==> Finished WinGet Repair"
2026-01-14 20:28:45 +02:00
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
}
2026-01-07 19:55:35 +00:00
}
```