Skip to content

Latest commit

 

History

History
95 lines (64 loc) · 4.11 KB

File metadata and controls

95 lines (64 loc) · 4.11 KB


💾 About The Project

Winget Repair Tool

The Winget Repair Tool is a targeted PowerShell script designed to fix common issues with the Windows Package Manager (winget). If you are encountering errors like "winget is not recognized" or profile loading errors related to winget.exe, this script performs a clean re-installation of the App Installer package to resolve them.

Built by: Zachary Whiteman & Google Gemini Ai.

(back to top)

🔰 Getting Started

This script is a repair utility for the Windows Package Manager.

🕰️ Prerequisites

To run this script, you will need:

  • Windows Operating System.
  • PowerShell 5.1 or newer.
  • Administrator Privileges: The script requires administrator access to uninstall and reinstall AppX packages for all users.
  • Internet Connection: Required to download the latest installer from the official GitHub repository.

💽 Installation & Execution

  1. Download: Download the Winget-Repair-Tool.PS1 script file.
  2. Unblock: Right-click the file, go to Properties, and click Unblock.
  3. Run as Administrator: Right-click the script and select "Run with PowerShell". Ensure you run it from an elevated context.
    .\Winget-Repair-Tool.PS1

(back to top)

🚀 Usage

The script runs automatically once launched as an administrator. It performs the following steps:

  1. Uninstall: It attempts to remove the existing "Microsoft.DesktopAppInstaller" package to clear out any corrupted files.
  2. Download: It downloads the latest stable winget release bundle (.msixbundle) directly from the official Microsoft GitHub repository.
  3. Install: It installs the downloaded package using Add-AppxPackage.
  4. Path Verification: It checks your User environment variables to ensure the Microsoft\WindowsApps directory is in your PATH. If missing, it adds it, ensuring you can run winget from any command prompt.

(back to top)

✨ Key Features

  • Clean Reinstall: Removes potentially broken installations before applying the new one.
  • Official Source: Downloads directly from the official microsoft/winget-cli GitHub releases.
  • Environment Fix: Automatically corrects PATH variable issues that prevent winget from being recognized.
  • Automated Cleanup: Deletes the temporary installer file after the operation is complete.

(back to top)

🛠️ Technology Stack

  • Scripting Language: PowerShell
  • Core Cmdlets: Get-AppxPackage, Remove-AppxPackage, Add-AppxPackage for managing the application.
  • Environment: .NET [Environment] class for modifying user variables.

(back to top)

📐 Architecture & Security Notes

  • Administrator Required: This script must be run as an administrator to manage system packages.
  • System Change: It modifies the installed AppX packages and User Environment variables.
  • Restart Required: After running, you typically need to close and reopen your terminal windows (PowerShell, CMD) for the PATH changes to take effect.

(back to top)

🪪 License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

☎️ Contact

Zach Whiteman - elitesoftwarecolimited@gmail.com

HuggingFace - https://huggingface.co/EliteSoftware

HuggingFace (Personal) - https://huggingface.co/TheShadyRainbow

LinkTree - https://linktr.ee/zachrainbow

Patreon - https://www.patreon.com/c/EliteSoftwareCo

(back to top)