Back to Winget Cli

install Command

doc/windows/package-manager/winget/install.md

1.28.2405.4 KB
Original Source

install command (winget)

The install command of the winget tool installs the specified application. Use the search command to identify the application you want to install.

The install command requires that you specify the exact string to install. If there is any ambiguity, you will be prompted to further filter the install command to an exact application.

Usage

winget install [[-q] <query>] [<options>]

The following command aliases are available:
add

Arguments

The following arguments are available.

ArgumentDescription
-q, --queryThe query used to search for an app.

Options

The options allow you to customize the install experience to meet your needs.

OptionDescription
-m, --manifestMust be followed by the path to the manifest (YAML) file. You can use the manifest to run the install experience from a local YAML file.
--idLimits the install to the ID of the application.
--nameLimits the search to the name of the application.
--monikerLimits the search to the moniker listed for the application.
-v, --versionEnables you to specify an exact version to install. If not specified, latest will install the highest versioned application.
-s, --sourceRestricts the search to the source name provided. Must be followed by the source name.
--scopeSelect install scope (user or machine)
-e, --exactUses the exact string in the query, including checking for case-sensitivity. It will not use the default behavior of a substring.
-i, --interactiveRuns the installer in interactive mode. The default experience shows installer progress.
-h, --silentRuns the installer in silent mode. This suppresses all UI. The default experience shows installer progress.
-o, --logDirects the logging to a log file. You must provide a path to a file that you have the write rights to.
--overrideA string that will be passed directly to the installer.
-l, --locationLocation to install to (if supported).
--forceOverride the installer hash check.
-a, --architectureSelect the architecture
--installer-typeSelect the installer type
--localeLocale to use (BCP47 format)
--customArguments to be passed on to the installer in addition to the defaults
--ignore-security-hashIgnore the installer hash check failure
--skip-dependenciesSkip processing package dependencies and Windows features
--ignore-local-archive-malware-scanIgnore the malware scan performed as part of installing an archive-type package from a local manifest
--dependency-sourceFind package dependencies using the specified source
--accept-package-agreementsAccept all license agreements for packages
--no-upgradeSkip upgrade if an installed version already exists
--headerOptional Windows-Package-Manager REST source HTTP header
--accept-source-agreementsAccept all source agreements during source operations
-r, --renameThe value to rename the executable file (portable)
--uninstall-previousUninstall the previous version of the package during the upgrade
--ignore-interactivityDisable interactive prompts
-?, --helpGet additional help on this command.
--waitPrompts the user to press any key before exiting
--logs, --open-logsOpen the default logs location
--verbose, --verbose-logsEnables verbose logging for winget
--disable-interactivityDisable interactive prompts

Example queries

The following example installs a specific version of an application.

CMD
winget install powertoys --version 0.15.2

The following example installs an application from its Package Identifier.

CMD
winget install --id Microsoft.PowerToys

The following example installs an application by version and ID.

CMD
winget install --id Microsoft.PowerToys --version 0.15.2

Multiple selections

If the query provided to winget does not result in a single application, then winget will display the results of the search. This will provide you with the additional data necessary to refine the search for a correct install.

The best way to limit the selection to one file is to use the id of the application combined with the exact query option. For example:

CMD
winget install --id Git.Git -e

If multiple sources are configured, it is possible to have duplicate entries. Specifying a source is required to further disambiguate.

CMD
winget install --id Git.Git -e --source winget

Local install

The manifest option enables you to install an application by passing in a YAML file directly to the client. If the manifest is a multi file manifest, the directory containing the files must be used. The manifest option has the following usage.

Usage: winget install --manifest <path>

OptionDescription
-m, --manifestThe path to the manifest of the application to install.

Log files

The log files for winget unless redirected, will be located in the following folder: %temp%\AICLI\*.log