mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-04-06 14:48:31 +00:00
* updated theme to the latest version * Update en.yaml * removed all the order from the docs * add the store link * update homepage * add filename and line number to all the code blocks and also removed pages * auto pull the code from the json files * Merge branch 'main' into winutil-new-features * the script updated linenostart= * Delete LaptopHibernation.md
30 lines
838 B
Markdown
30 lines
838 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 -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"
|
|
}
|
|
|
|
}
|
|
```
|