mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-06 06:38:31 +00:00
31 lines
834 B
Markdown
31 lines
834 B
Markdown
---
|
|
title: "WinGet Reinstall"
|
|
description: ""
|
|
---
|
|
|
|
```powershell {filename="functions/public/Invoke-WPFFixesWinget.ps1",linenos=inline,linenostart=1}
|
|
function Invoke-WPFFixesWinget {
|
|
|
|
<#
|
|
|
|
.SYNOPSIS
|
|
Fixes WinGet by running `choco install winget`
|
|
.DESCRIPTION
|
|
BravoNorris for the fantastic idea of a button to reinstall WinGet
|
|
#>
|
|
# Install Choco if not already present
|
|
try {
|
|
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
|
|
Write-Host "==> Starting WinGet Repair"
|
|
Install-WinUtilWinget
|
|
} catch {
|
|
Write-Error "Failed to install WinGet: $_"
|
|
Set-WinUtilTaskbaritem -state "Error" -overlay "warning"
|
|
} finally {
|
|
Write-Host "==> Finished WinGet Repair"
|
|
Set-WinUtilTaskbaritem -state "None" -overlay "checkmark"
|
|
}
|
|
|
|
}
|
|
```
|