Quick Start | Safety Standards | Microsoft Intune Guide | SCCM & MDT Guide | Extended Docs | Testing Suite | Use Cases & Causes
A safe, single-profile utility engineered to diagnose and repair corrupted Windows Package Manager (winget) execution aliases, broken NTFS reparse points, and asymmetrical profile registry inconsistencies on Windows 11.
- The "Open With" Loop: Permanently breaks out of the loop where running
wingetrepeatedly prompts the user to select a GUI handler app. - Mangled Reparse Points: Forcefully purges corrupted execution alias files in
%USERPROFILE%\AppData\Local\Microsoft\WindowsAppsthat standard shell commands fail to delete. - Elevation Profile Mismatches: Corrects registry
PATHvariables within the active user's environment block, even when executed from an elevated administrative context.
To evaluate your system state and interactively apply fixes, execute the following command block from a native Windows PowerShell or PowerShell Core console:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
& ([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing '[https://raw.githubusercontent.com/aj1126/winget-diagnostic-tool/main/Repair-WingetAlias.ps1').Content](https://raw.githubusercontent.com/aj1126/winget-diagnostic-tool/main/Repair-WingetAlias.ps1').Content)))
For headless deployment image scrubbing or silent profile repairs, append the -Force switch:
.\Repair-WingetAlias.ps1 -ForceFor native Intune deployment with single-file IME isolation and zero external dependencies, upload the standalone scripts located in the intune/ directory:
- Detection Script:
intune/Detection.ps1(Exits0for Compliant,1for Non-compliant) - Remediation Script:
intune/Remediation.ps1(Exits0for Success,1for Error) - See
intune/README.mdfor the complete Intune deployment runbook.
For OSD imaging pipelines, Active Setup staging, or Configuration Baselines, consult the dedicated deployment runbook in the sccm/ directory:
- Active Setup Staging:
sccm/Install-ActiveSetupStage.ps1(Stages tool and registers HKLM Active Setup for multi-user OSD) - See
sccm/README.mdfor the complete Task Sequence configuration guide, variable handling (_SMSTSLastActionSucceeded), and exit-code mapping.
The script and module return deterministic exit codes to simplify enterprise orchestration:
0: Success (System healthy or repaired successfully).1: Failure (Error during execution or verification failure).2: Dry-run mode completed successfully with simulated changes.3: Rollback completed successfully.
System utility execution demands strict isolation and deterministic boundaries. This engine operates under a non-destructive legal sandbox paradigm:
- Transactional Backups: Prior to altering any registry keys under the user's environment block, the tool exports structured
.regfiles locally so changes can be reverted with a double-click. - Low-Level .NET Deletions: To bypass NTFS reparse point file locks where high-level cmdlets fail (
Remove-Item), the script accesses the underlying file system primitives directly via[System.IO.File]::Delete(). - Asymmetrical Elevation Protection: The script maps the actual interactive user token via
explorer.exeprocess ownership rather than targeting the administrator profile's registry hive, preventing configuration bleed. - Deterministic Verification Framework: Zero guesswork. The remediation tree evaluates state changes post-fix and monitors thread stability using an explicit 3-second diagnostic execution timeout.
If you are looking for the original technical deep dives, architectural breakdowns, historical edge cases, or deep platform context regarding this project:
- 📄 Read the full guide: Extended Documentation Reference
- 🔍 Root Causes & Scenarios: Use-Cases & Root Cause Analysis
- PSScriptAnalyzer Lint Compliance: 0 errors and 0 warnings on
Repair-WingetAlias.ps1, checked on every pull request (lint.yml) - Integration Tests: the full E2E suite (
tests/Run-Tests.ps1, Windows PowerShell 5.1 only) runs on every pull request (tests.yml) and must pass before a release is published (release.yml)