Files
winutil/docs/content/dev/features/Fixes/Winget.md
2026-03-06 08:29:10 -06:00

832 B

title, description
title description
WinGet Reinstall
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"
    }

}