mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-04 15:00:09 +00:00
24 lines
685 B
PowerShell
24 lines
685 B
PowerShell
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 -Force
|
|
} 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"
|
|
}
|
|
|
|
}
|