import command (winget)
The import command is often used to share your developer environment or build up your PC image with your favorite apps.
winget import [-i] <import-file> [<options>]
The following arguments are available.
|-i,--import-file||JSON file describing the packages to install.|
The options allow you to customize the import experience to meet your needs.
|--ignore-unavailable||Suppresses errors if the app requested is unavailable.|
|--ignore-versions||Ignores versions specified in the JSON file and installs the latest available version.|
The driving force behind the import command is the JSON file. You can find the schema for the JSON file here.
The JSON file includes the following hierarchy.
|Sources||The sources application manifests come from.|
|Packages||The collection of packages to install.|
|Id||The Windows Package Manager package identifier used to specify the package.|
|Version||[optional] The specific version of the package to install.|
When the Windows Package Manager imports the JSON file, it attempts to install the specified applications in a serial fashion. If the application is not available or the application is already installed, it will notify the user of that case.
In the previous example, the Microsoft.WindowsTerminal was already installed. Therefore the import command skipped passed the installation.