Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair-WingetPackageManager -force does not force repair #4981

Open
Surawsome opened this issue Nov 17, 2024 · 5 comments
Open

Repair-WingetPackageManager -force does not force repair #4981

Surawsome opened this issue Nov 17, 2024 · 5 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention Issue needs attention from Microsoft PowerShell Issue related to WinGet PowerShell Module or cmdlet

Comments

@Surawsome
Copy link

Brief description of your issue

Running the command Repair-WingetPackageManager with -force does not force a repair. This prevents updates and repairs from being possible even when the application is not working correctly.

Steps to reproduce

Run the command Repair-WingetPackageManager -force -verbose

Expected behavior

DesktopAppInstaller will reinstall or update

Actual behavior

Image
Currently, even if winget is not in a good state, the command will fail

Environment

Windows 11 24H2
V1.9.25190
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Nov 17, 2024
@denelon
Copy link
Contributor

denelon commented Nov 17, 2024

Try adding "-Latest" to the command to get the latest stable version of WinGet installed.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage Issue need to be triaged label Nov 17, 2024
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage Issue need to be triaged PowerShell Issue related to WinGet PowerShell Module or cmdlet and removed Needs-Triage Issue need to be triaged labels Nov 17, 2024
@Surawsome
Copy link
Author

Try adding "-Latest" to the command to get the latest stable version of WinGet installed.

Image

Same issue unfortunately

@UziKhana
Copy link

UziKhana commented Nov 18, 2024

Step 1:
In powershell run wsreset.exe to reset Microsoft Store cache

Step 2:
Download App Installer from https://learn.microsoft.com/
Downloaded file: Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
Right click install wont work.

Step 3:
Goto folder %LocalAppData%\Microsoft\WindowsApps\
Goto folder Microsoft.DesktopAppInstaller_8wekyb3d8bbwe or similar
Rename winget.exe to winget.exe.old
Now right click and install on downloaded file from step 2 Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle should work

Step 4
In powershell run Repair-WingetPackageManager -force -latest -verbose, successful output is WinGet is in a good state.

@Trenly
Copy link
Contributor

Trenly commented Nov 23, 2024

I think the issue here is that the version of WinGet that is installed is the correct version, and, it has to be "working" because otherwise it wouldn't report its version. So, the cmdlet is actually doing exactly what it is coded to do - make sure the specified version of WinGet is installed and that the executable runs.

I think the bigger question here is - why were you calling Repair-WingetPackageManager ? What issue were you trying to solve using it? What issue did you expect it to resolve? Knowing this will help determine if improvements need to be made to how the cmdlet behaves

Edit: There is also a feature request in #4947 to have -Force bypass all checks

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback Issue needs attention from issue or PR author label Nov 23, 2024
@Surawsome
Copy link
Author

So something I've learned is the winget -v will almost always work if the application is not functioning correctly. One of the most common issues is the sources not working correctly and neither winget source update or reset resolve the issue but since it reports a version, it won't force a reinstall

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention Issue needs attention from Microsoft PowerShell Issue related to WinGet PowerShell Module or cmdlet
Projects
None yet
Development

No branches or pull requests

4 participants