2025年7月4日 星期五

執行winget出現錯誤

 執行winget出現:

winget: The term 'winget' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.


以系統管理員身分開啟 PowerShell,執行下列指令:

Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe

如果不行

安裝 WinGet PowerShell 模組,並執行修復指令:

Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery

Repair-WinGetPackageManager