winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

WinGet fails in Windows PowerShell but runs via PowerShell in Windows Terminal

Open denelon opened this issue 1 year ago • 3 comments

As can be seen here.

https://github.com/microsoft/winget-cli/assets/9511158/6bb893f2-1fc0-4dc6-a896-2755fb5f3a9b

Originally posted by @Battler624 in https://github.com/microsoft/winget-cli/discussions/4427

denelon avatar May 31 '24 00:05 denelon

Winget-info does not work on either powershell or powershell via terminal

winget-info : The term 'winget-info' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ winget-info
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (winget-info:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Battler624 avatar Jun 04 '24 10:06 Battler624

Can you install the Microsoft.WinGet.Client PowerShell module and try running Repair-WinGetPackageManager -Latest -Force and let me know if that resolves the issue?

denelon avatar Jun 04 '24 15:06 denelon

Can you install the Microsoft.WinGet.Client PowerShell module and try running Repair-WinGetPackageManager -Latest -Force and let me know if that resolves the issue?

Winget now works in both, winget-info still doesn't work.

Edit: Winget --info works tho.

https://i.imgur.com/7CvbJ5x.png

Battler624 avatar Jun 05 '24 09:06 Battler624

Can you install the Microsoft.WinGet.Client PowerShell module and try running Repair-WinGetPackageManager -Latest -Force and let me know if that resolves the issue?

Thanks this worked for me! Difference was that winget itself was not working in any terminal window, but now it is again, thank you

JordyEGNL avatar Dec 02 '24 09:12 JordyEGNL

I'm no longer able to reproduce this error.

denelon avatar Dec 11 '24 17:12 denelon