mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-27 16:44:46 -05:00

* add proper error handling + Taskbaritem support to WPFSystemRepair * implement other fixes - add Taskbarprogress to WPFFixesNetwork - add Taskbarprogress to WPFFixesUpdate - add Error handling + Taskbarprogress to WPFFixesWinget - add finalisation in WPFSystemRepair
24 lines
730 B
PowerShell
24 lines
730 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"
|
|
Install-WinUtilChoco
|
|
Start-Process -FilePath "choco" -ArgumentList "install winget -y --force" -NoNewWindow -Wait
|
|
} 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"
|
|
}
|
|
|
|
}
|