source add command adds a new package source to WinGet’s configuration.
Syntax
Required Options
Name for the source (must be unique)
Source Configuration
Source URL or path. Required for most source types.
Source type:
Microsoft.PreIndexed.Package (default), Microsoft.Rest, Microsoft.PreIndexed.ZipTrust level:
None (default) or TrustedMark source as explicit (won’t be used in default searches)
Source priority (lower number = higher priority). Default: 0
Authentication
Custom HTTP header for authentication (format: “Name: Value”)
Accept source agreements without prompting
Examples
Add a basic custom source:Source Types
Microsoft.PreIndexed.Package (Default)
Standard WinGet source with pre-indexed package database.Microsoft.Rest
REST API-based source for enterprise scenarios.Microsoft.PreIndexed.Zip
Offline ZIP file-based source.Trust Levels
None (Default)
Standard trust level with normal security prompts.Trusted
Marks source as trusted, which may reduce security prompts:Explicit Sources
Explicit sources are not searched by default. Users must specify them with--source:
Priority
Control search order with priority. Lower numbers = higher priority:Exit Codes
0- Success0x8A150015- Source already exists0x80070005- Access denied (requires administrator)
Adding sources requires administrator privileges.