Connect devices with winget
Devices reach your source through a source key. With no key, a device sees nothing. Revoking a key stops every device that uses it from getting updates.
Before you begin
Section titled “Before you begin”- Permission: Manage settings (
settings:write) to create or revoke keys. - Plan: all plans.
- At least one approved version, so you can test. See the Quickstart.
Create a source key
Section titled “Create a source key”- Go to Devices & Access › Connect devices.
- Under Point WinGet at your source, choose Create source key.
- Enter a Label. Name it after the deployment channel, for example
Intune: all laptops. - Choose Create key.
- Copy the winget source add command. It is shown once.
- Choose Test connection. A working key answers “Connected.”
- Choose I’ve copied it.
Use one key per deployment channel, so you can revoke each one on its own.
Add the source to a device
Section titled “Add the source to a device”Run the command in an elevated PowerShell or Command Prompt:
winget source add --name contoso --arg https://api.endpointworks.com/api/winget/t/ews_xxxxxxxx --type Microsoft.RestThen check it:
winget source listwinget search 7zip --source contosoExpected result: winget search finds the package, and winget show 7zip.7zip --source contoso --versions lists only the versions you approved.
Install from the source
Section titled “Install from the source”winget install --id 7zip.7zip --source contoso --scope machineAdd --scope machine for portable apps when you install elevated. Without it, winget installs a portable app for the current user, and an elevated winget uninstall can’t remove it later.
Deploy the source at scale
Section titled “Deploy the source at scale”| Tool | How |
|---|---|
| Intune | A platform script or a Win32 app that runs the winget source add command as System. |
| Group Policy | A computer startup script that runs the command. |
| RMM or ConfigMgr | Run the command as SYSTEM. |
The command contains the key. Treat it like a password and keep it out of tickets and chat.
Revoke a key
Section titled “Revoke a key”- Go to Devices & Access › Connect devices.
- Choose Revoke on the key, then Revoke source key.
Result: devices using that key get no updates and can no longer search or install from the source. Add a new key to the devices that should keep access.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| Test connection says the source doesn’t recognise the key | The key was revoked, or mistyped | Create a new key. |
| Test connection says the key is rate limited | Too many requests in a short time | Retry in a minute. |
winget source add fails with a certificate or connection error |
The device can’t reach the API host over HTTPS | Check proxy and TLS inspection rules for the API host. |
No package found matching input criteria |
The version isn’t approved, or it was blocked | Check Approvals. A blocked version isn’t served. |
Uninstall fails with 0x8A15007D |
A portable app was installed in user scope | Reinstall with --scope machine. |
More: winget errors.