winget-cli README

The project's README from github.com/microsoft/winget-cli. As one markdown file: README.md.

WinGet Icon Windows Package Manager

WinGet Client

winget install wingetcreate

If you are new to the Windows Package Manager, you might want to Explore the Windows Package Manager tool. The client has access to packages from two default sources. The first is "msstore" the Microsoft Store (free Apps rated "e" for everyone). The second is "winget" the WinGet community repository.

[!NOTE] Group policy may be configured and modify configured sources. Run winget --info to see any configured policies.

Installing The Client

[!NOTE] The client requires Windows 10 1809 (build 17763), Windows 11, Windows Server 2025, or later at this time. Windows Server 2019 and 2022 can run it experimentally (not supported) by extracting the .msixbundle; see https://github.com/microsoft/winget-cli/issues/4502#issuecomment-4585558561. Due to hard reliances on IsWow64Process2 and MSIX, it cannot be run on Windows Server Core or on Windows versions earlier than Windows 10 1809.

The client is distributed within the App Installer package.

Development Releases

There are a few methods to get development releases:

[!NOTE] If you decide to install the latest release from GitHub, and you have successfully joined the insider program, you will receive updates when the next development release has been published in the Microsoft Store.

Once you have received the updated App Installer from the Microsoft Store you should be able to execute winget features to see experimental features. Some users have reported issues with the client not being on their PATH.

Manually Update

The same Microsoft Store package will be made available via our Releases. Note that installing this package will give you the WinGet client, but it will not enable automatic updates from the Microsoft Store if you have not joined the Windows Package Manager Insider program.

[!NOTE] You may need to install the VC++ v14 Desktop Framework Package. This should only be necessary on older builds of Windows 10 and only if you get an error about missing framework packages.

Troubleshooting

Please read our troubleshooting guide.

PowerShell Module

The Microsoft.WinGet.Client PowerShell module provides native cmdlets for interacting with the Windows Package Manager. You can install it from the PowerShell Gallery:

Install-Module -Name Microsoft.WinGet.Client

Example usage:

# Search for a package
Find-WinGetPackage -Query "Visual Studio Code"

# Install a package
Install-WinGetPackage -Id Microsoft.VisualStudioCode

# List installed packages
Get-WinGetPackage

# Update a package
Update-WinGetPackage -Id Microsoft.VisualStudioCode

# Repair the WinGet package manager installation
Repair-WinGetPackageManager

For more information, see the Microsoft.WinGet.Client page on the PowerShell Gallery.

Administrator Considerations

Installer behavior can be different depending on whether you are running WinGet with administrator privileges.

Build your own

You can also build the client yourself. While the client should be perfectly functional, we are not ready to provide full support for clients running outside of the official distribution mechanisms yet. Feel free to file an Issue, but know that it may get lower prioritization.

Build Status

Build Status

Windows Package Manager Release Roadmap

The plan for delivering the next Windows Package Manager release is described and included in our discussions, and will be updated as the project proceeds.

Overview of the Windows Package Manager

The Windows Package Manager is a tool designed to help you quickly and easily discover and install those packages that make your PC environment special. By using the Windows Package Manager, from one command, you can install your favorite packages:

winget install <package>

Overview

Client Repository

This winget-cli repository includes the source code designed to build the client. You are encouraged to participate in the development of this client. We have plenty of backlog features in our Issues. You can upvote the ones you want, add more, or even get started on one.

Sources

The client is built around the concept of sources; a set of packages effectively. Sources provide the ability to discover and retrieve the metadata about the packages so that the client can act on it.

Building the client

Please follow our developer guidance to build, run & test the client.

Credit

We would like to thank Keivan Beigi (@kayone) for his work on AppGet which helped us with the initial project direction for Windows Package Manager.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and do, actually grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. More information is available in our CONTRIBUTING.md file.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, please refer to the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Data/Telemetry

The winget.exe client is instrumented to collect usage and diagnostic (error) data and sends it to Microsoft to help improve the product.

If you build the client yourself the instrumentation will not be enabled and no data will be sent to Microsoft.

The winget.exe client respects machine-wide privacy settings and users can opt out on their device, as documented in the Microsoft Windows privacy statement. In addition, you may also explicitly block telemetry using settings

In short, to opt out, do one of the following:

Windows 11: Go to Start, then select Settings > Privacy & Security > Diagnostics & feedback > Diagnostic data and unselect Send optional diagnostic data.

Windows 10: Go to Start, then select Settings > Privacy > Diagnostics & feedback, and select Required diagnostic data.

See the privacy statement for more details.

winget-cli (microsoft/winget-cli)

Searching Database…

这是什么?WinGet 是 Windows 程序包管理器的客户端,一个命令行工具,可以帮你快速查找并安装各种软件包,轻松配好你的电脑环境。
它只是一个命令行工具,还是有别的内容?核心是 winget.exe 这个命令行工具,但该项目还提供带有原生 cmdlet 的 Microsoft.WinGet.Client PowerShell 模块,以及一个 COM API,方便你在自己的代码中调用它。
怎么把它装到我的电脑上?最简单的方式:它内置在 Microsoft Store 的“应用安装程序”包里。如果想用开发版本,可以前往 Releases 页面,或者运行 Repair-WinGetPackageManager cmdlet 并加上 -IncludePrerelease 参数。
哪些 Windows 版本能运行它?Windows 10 1809(内部版本 17763)、Windows 11,或者 Windows Server 2025 及更高版本。Server 2019 和 2022 只能实验性地运行;Server Core 以及比 1809 更早的版本均不受支持。
安装总能成功吗,还是需要管理员权限?不一定:有些安装程序需要提升权限。如果没有管理员权限,Windows 会弹出提升权限的提示,拒绝的话该应用就无法安装;在已提升权限的命令行中则不会有任何提示。
这个客户端会把数据发给 Microsoft 吗?会。官方的 winget.exe 会收集使用情况和诊断数据并发送给 Microsoft,同时遵循你设备上的诊断数据设置,可以选择退出。你自己编译的客户端则不会发送任何数据。
这些软件包到底是从哪里来的?有两个默认源:'msstore' 是 Microsoft Store 里面向所有人开放评分的免费应用,'winget' 是 WinGet 社区仓库。你也可以自建私有的基于 REST 的源。
客户端装好之后,我该怎么安装软件包?一条命令就行:winget install 。用一条命令查找并安装你喜欢的软件包,正是这个工具的核心所在。
我能用 PowerShell 或自己的代码来自动化操作吗?可以。Microsoft.WinGet.Client 模块可以从 PowerShell Gallery 安装,提供原生 cmdlet;该项目还为应用程序提供了 COM API。
安装开发版本时,大家容易在哪些地方踩坑?有用户反映 winget 不在 PATH 里。较旧的 Windows 10 版本可能需要 VC++ v14 Desktop Framework 包,而且要接收 Store 的自动更新需要加入 Insider 计划。
Creator
microsoft
Size
46 MB
Stars
26.5K
Age
7y
Commits · 90 Days