Solutions to Resolve “Winget Is Not Recognized” Error on Windows

Solutions to Resolve “Winget Is Not Recognized” Error on Windows

For Windows users, the Windows Package Manager, commonly known as WinGet, serves as a vital tool for installing and managing applications easily via PowerShell, Command Prompt, or other command-line interfaces. However, encountering an error stating that “WinGet is not recognized as a valid cmdlet, function, or script file”can be frustrating. This comprehensive guide will illuminate effective methods to resolve this error and restore WinGet functionality.

1. Re-register or Repair WinGet

A common reason for the WinGet error is a corrupt or improperly configured installation of the Windows Package Manager. Fortunately, re-registering WinGet can usually resolve such issues by resetting its installation.

To begin, search for PowerShell in your system’s search bar, right-click on it and select Run as Administrator. In the PowerShell window, execute the following command:

Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft. DesktopAppInstaller_8wekyb3d8bbwe

WinGet being re-registered through PowerShell.

This command instructs Windows to re-register the App Installer from its official Microsoft source, effectively restoring WinGet’s functionality. Alternatively, you can repair the existing WinGet package by using the same command as mentioned above.

Repairing WinGet by identifying the installed package.

Upon successful execution, Windows will swiftly regain access to WinGet and rectify issues within the Windows Package Installer, such as broken shortcuts and missing components.

2. Enable App Execution Alias for Windows Package Manager

In the command-line environment, “WinGet”functions as the execution alias for the Windows Package Manager.

App execution aliases allow abbreviated command-line instructions, and disabling this feature can hinder WinGet’s recognition, often due to third-party system optimization tools.

To enable the app execution alias, press Win + I to access the Settings app. Navigate to AppsAdvanced app settingsApp execution aliases, and make sure the toggle for Windows Package Manager Client is set to On.

Configuration settings for App Execution Aliases.

Windows 10 users can find this toggle under SettingsAppsApps & Features by selecting the App execution aliases link.

3. Check for the Latest Version of App Installer

Since WinGet is integrated with the App Installer—a crucial component for simplifying software installations—malfunctions in the App Installer can trigger the WinGet error. Therefore, ensuring you have the latest version of App Installer is essential.

Navigate to the official App Installer download page and click on the prominent Download button. Make sure to follow the prompts for an MSIXBUNDLE file download.

Downloading the App Installer online.

If the message indicates that App Installer is already installed, select Reinstall to rectifying missing dependencies or choose to update via the Microsoft Store if prompted.

Fun Fact: With WinGet, users can download web browsers directly on Windows without the need for existing browsers.

4. Reinstall App Installer from GitHub

If updating the App Installer doesn’t resolve the issue, consider a complete reinstallation as a potential fix. Follow these steps carefully:

Access the Windows Package Manager GitHub repository.

Locate the Assets section, then click the MSIXBundle file for the Desktop App Installer to begin the download process.

Downloading the MSIXBundle for Desktop App Installer.

Open the downloaded file and click Reinstall in the prompt that appears to continue.

Option to reinstall App Installer.
  • Continue following the on-screen instructions to finalize the reinstallation of App Installer.

5. Add WinGet to the Path Environment Variable

When initiating a WinGet command, Windows references the PATH variable to locate necessary executable files. If the directory for WinGet executables is not included in this PATH, an error will arise.

To manually add the required directory to the PATH variable, execute the following:

Press Win + R to open the Run dialog. Type systempropertiesadvanced and click OK to open the System Properties window.

Accessing System Properties via Run command.

Switch to the Advanced tab and click on Environment Variables.

Navigating to Environment Variables in System Properties.

Select the Path variable and click Edit to open the editing window for the environment variable.

Editing the Environmental Variable settings.

Add the following file path: %UserProfile\AppData\Local\Microsoft\WindowsApps.

In the editing window, click New, paste the copied path, and confirm by clicking OK to save your changes.

Adding a new entry in the Environment Variable editor.

6. Adjust App Package Deployment Settings in Local Group Policy Editor

For Windows Pro or Enterprise users, verifying group policy settings is essential. Open the Group Policy Editor by entering gpedit.msc in the Run dialog.

Navigate through the following path: Computer ConfigurationAdministrative TemplatesWindows ComponentsApp Package Deployment.

Group Policy settings for App Package Deployment.

Here, most components might display a Not Configured status. Focus on enabling “Allow deployment operations in special profiles” and “Allow all trusted apps to install” by double-clicking these entries and selecting Enabled in the following pop-up, followed by OK.

7. Repair the App Installer Cache Using Multiple Methods

Repairing the cache of various application services can also help. Access the Control Panel and navigate to ProgramsPrograms and Features. Locate App Installer in the list.

If found, right-click and select Repair; alternatively, you could choose Uninstall and then reinstall from GitHub as outlined earlier. Another option is to open the Run dialog and enter wsreset.exe to clear the Microsoft Store cache, allowing WinGet commands to function smoothly.

8. Restore Your Windows PC to Factory Settings

If all else fails, it may indicate deeper issues or corruption within your operating system. In such cases, resetting Windows to factory defaults might be the best solution. However, ensure you back up all critical data beforehand, as this process will erase everything on your device.

Making WinGet Functional Again on Your PC

For command-line enthusiasts, WinGet is an invaluable utility for software installations. If command-line interfaces fail to recognize it, it can detract from your Windows experience. By following the troubleshooting guidelines presented above, you can restore WinGet’s functionality and enhance your workflow.

As an alternative, consider exploring Chocolatey as a package manager for varied application installations on your Windows system.

Source&Images

Leave a Reply

Your email address will not be published. Required fields are marked *