install command (winget)
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.
winget install [[-q] \<query> ...] [\<options>]
The following aliases are available for this command:
The following arguments are available.
|The query used to search for an app.
The query argument is positional. Wild-card style syntax is not supported. This is most often the string of characters you expect to uniquely identify the package you wish to install.
The options allow you to customize the install experience to meet your needs.
|Must 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.
|Limits the install to the ID of the application.
|Limits the search to the name of the application.
|Limits the search to the moniker listed for the application.
|Enables you to specify an exact version to install. If not specified, latest will install the highest versioned application.
|Restricts the search to the source name provided. Must be followed by the source name.
|Allows you to specify if the installer should target user or machine scope. See known issues relating to package installation scope.
|Select the architecture to install.
|Select the installer type to install. See supported installer types for WinGet client.
|Uses the exact string in the query, including checking for case-sensitivity. It will not use the default behavior of a substring.
|Runs the installer in interactive mode. The default experience shows installer progress.
|Runs the installer in silent mode. This suppresses all UI. The default experience shows installer progress.
|Specifies which locale to use (BCP47 format).
|Directs the logging to a log file. You must provide a path to a file that you have the write rights to.
|Arguments to be passed on to the installer in addition to the defaults.
|A string that will be passed directly to the installer.
|Location to install to (if supported).
|Ignore the installer hash check failure. Not recommended.
|Ignore the malware scan performed as part of installing an archive type package from local manifest.
|Find package dependencies using the specified source.
|Used to accept the license agreement, and avoid the prompt.
|Used to accept the source license agreement, and avoid the prompt.
|Skips upgrade if an installed version already exists.
|Optional Windows-Package-Manager REST source HTTP header.
|The value to rename the executable file (portable)
|Uninstall the previous version of the package during upgrade
|Direct run the command and continue with non security related issues.
|Get additional help on this command.
|Prompts the user to press any key before exiting.
|Open the default logs location.
|Used to override the logging setting and create a verbose log.
|Disable interactive prompts.
The following example installs a specific version of an application.
winget install powertoys --version 0.15.2
The following example installs an application from its ID.
winget install --id Microsoft.PowerToys
The following example installs an application by version and ID.
winget install --id Microsoft.PowerToys --version 0.15.2
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:
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.
winget install --id Git.Git -e --source winget
The msstore source uses unique identifiers as the "Id" for packages. These do not require the exact query toption. For example:
winget install XP9KHM4BK9FZ7Q -s msstore
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.
winget install --manifest \<path>
|The path to the manifests of the application to install.
Installing packages from local manifest files may have risks. As an extra measure of precaution this feature needs to be enabled by an administrator. To enable this feature run
winget settings --enable LocalManifestFiles. To disable this feature run
winget settings --disable LocalManifestFiles.
The log files for winget unless redirected, will be located in the following folder: %temp%\AICLI\*.log
Some applications when installed will require the user to agree to the license or other agreements before installing. When this occurs, the Windows Package Manager will prompt the user to agree to the agreements. If the user does not agree, the application will not install.
From the command line, you can auto accept the agreements by passing the following option --accept-package-agreements on the command line. This can be beneficial when scripting the Windows Package Manager.