Как установить winget через cmd

от admin

How to Install winget (Windows Package Manager)

winget is an open-source Windows package manager designed by Microsoft for Windows 10 and Windows 11. The client installs and manages applications using a CLI, similar to the apt package manager in Linux.

In this tutorial, you will learn to install and use the winget package manager for Windows.

How to install and use winget on Windows.

  • A computer running Windows 10 or 11.
  • Administrator privileges.
  • A network connection.

How to Install winget

There are two ways to install winget :

  • From the Microsoft Store.
  • Manually, using a package installer from GitHub.

Note: The winget client requires Windows 10 1809 (build 17763) or newer. Windows Server 2019 isn’t supported because the Microsoft Store and other dependencies are not available for Windows Server.

If you are already running Windows 10 1809 or newer, the client may already be available on your system. Check if winget is available by invoking the winget command in the Command Prompt or PowerShell:

1. Open the Windows Start menu, type powershell, and press Enter.

Open the Windows PowerShell app.

2. In the PowerShell, run winget to check if the app is installed:

Winget not found error.

In the example above, invoking the command states that winget is not recognized, which means it isn’t installed on the system.

Method 1: Install winget via Microsoft Store

Follow the steps below to install winget from the Microsoft Store:

1. Open the Windows Start menu, type store, and press Enter to open the Microsoft Store app.

Open the Microsoft Store app.

2. In the search bar, type winget and press Enter. In the results, click the App Installer application.

Search for winget in the Microsoft Store.

Note: The winget client is distributed within the App Installer package.

3. On the App Installer page, click Get to install the app.

Install winget using the Microsoft Store.

Wait for the installation to finish.

4. Verify the installation by invoking winget in Windows PowerShell or the Command Prompt:

Running winget in Microsoft PowerShell.

The command prints the program version, syntax, and available options.

Method 2: Install winget via GitHub

Another way to install winget is by downloading the installer from GitHub. Follow the steps below:

1. Navigate to the winget GitHub page.

2. Under the Releases section, click the latest available release.

Microsoft

3. On the Version page, scroll down to the Assets section and click the .msixbundle file to start the download.

Download the latest winget version from GitHub.

4. Run the downloaded file and click Update:

Installing winget using the GitHub installer.

Wait for the installation process to finish. The app may automatically install additional dependencies required for winget to work.

5. Verify the installation by running winget in PowerShell or Command Prompt.

How to Use winget

The winget client allows you to search, install, update, and remove packages. This section shows how to manage packages with winget .

The first time you use winget , a prompt appears asking if you agree to Microsoft’s transaction terms. This is because the Microsoft Store repository requires your geographic region to function correctly.

Read the terms, and if you agree, type y and press Enter to confirm.

Install Packages

Install a package with winget using the following syntax:

For [package_name] , specify the exact application ID. In the following example, we instruct winget to install Notepad++, and winget prompts for the app ID since Notepad++ is available in two repositories.

Winget prompts for the exact app name for installation.

After specifying the exact application ID, winget automatically downloads and installs Notepad++.

Installing an app using winget.

Search for Packages

Use winget to search for available packages in the public Windows Package Manager Community repository or in the Microsoft Store. The syntax is:

In the following example, we search for the MySQL server:

Searching for available packages in winget.

The output is a list of all available packages containing the mysql keyword.

Show Package Details

Display information about installed packages using the following command:

Obtaining a package

The output shows the specified app information, including the program version, publisher, author, and program description.

Manage Sources

winget installs packages from online repositories. The two official winget repositories are:

  • msstore . The Microsoft Store repository.
  • winget . The winget software repository maintained by Microsoft.

Use the winget source command to add, remove, list, or update the repositories.

1. List Repositories

See which repositories winget is using by running:

Getting a list of repositories winget uses for package management.

The output shows a list of repositories currently in use.

2. Add Repository

Add a third-party repository to winget using the add subcommand. The syntax is:

For [name] , specify the name you want for the repository, and for [url] , specify the repository URL.

Adding a third-party repository to winget.

In this example, we have added the official winget repository.

3. Update Repositories

Force an update to the existing repositories using the update subcommand. Run:

Updating the existing repositories in winget.

The command updates the existing repositories with the latest package information.

4. Remove a Repository

Remove a repository from winget using the remove subcommand. The syntax is:

Removing a repository from winget.

The specified repository is automatically removed.

5. Reset winget Sources

Use the reset —force subcommand to reset winget back to its original configuration, removing all third-party repositories and setting the sources to the default ones.

Resetting winget repositories back to the default state.

List Packages

See a list of all installed packages using the list option. Run:

Getting a list of installed apps using winget.

In the example above, the output includes the list of installed applications, including the application ID, version, and available updates.

Uninstall Packages

Uninstall an application using the uninstall option. The syntax is:

Uninstalling an app using winget.

This tutorial showed how to install and use the winget package manager on Windows. Use winget to automate package management, installation, and configuration, while keeping your apps up to date and system secure.

The Windows package manager, winget

The Windows package manager, winget

Microsoft is working on a package manager for Windows, called winget.

You might want to compare it to other package managers. Perhaps to a really to popular one on Linux. An Your browser does not support the audio element. apt speaker icon

comparison, if you will.

The command line tool enables you to install, update, remove and configure applications.

Programs installed via the command line interface will be available everywhere you expect them to be, like in the Windows control panel.

The project is open-source. Take a look at the — mainly C++ — repository.

The CLI uses small pieces of data (called manifest files) to enable a lot of its features. They’re YAML files that contain a bunch of information about a package. They follow a rigid structure.

Those files are hosted on an other public GitHub repository. This method of supplying information to the CLI tool is used to keep more packages up to date. It encourages outside contributions by keeping the barrier to add/modify a package reasonably low. Proposing a change to the information of a package is the result of submitting a pull request to that repository with a manifest file.

Because the CLI executes the installation file from a package’s manifest, it might need administrator privileges to install that file. If you aren’t using an elevated command prompt, you might see a UAC prompt asking you to confirm first.

Installation

While it is going to be a part of Windows 10 by default, winget isn’t released as a stable version yet. Until that happens, installing it means jumping through some hoops.

There are 2 options: to Microsoft store, or not to Microsoft store.

Either: via the Microsoft store

The command line interface is distributed via the App Installer package on the Microsoft store. To get access to it before the release of winget , you can do 2 things:

Become part of the Windows Insider program (and run a prerelease a version of Windows).

Or: Manual install

It can be manually installed by downloading and executing a .appxbundle attached to a release from the GitHub releases page.

If you install winget manually:

  • You won’t get automatic updates to winget .
  • You may need the VC++ v14 Desktop Framework Package

Because the project is open-source: the last, and most time/resource intensive option is building your own version.

Features

During development, a lot of features are added and tweaked. You can take a look at what to expect for the initial release on the v1 roadmap.

They are publically tracking work on requested features. You can follow along with, or contribute to the development of the winget tool.

Configuration

Configuration is done via a setting.json file. It uses a JSON-schema, and I think JSON-schema’s are awesome!

Opening the file in your standard editor via the CLI:

Enable experimental features

To get access to some features that aren’t stable yet early, you’ll have to opt-in. You can see a list of them, and their current status by executing:

At the time of writing, a lot of functionality is considered experimental, like the ability to uninstall, or to upgrade packages.

Here, I enabled a few of these features by turning the boolean flag associated with them on:

The experimentalMSStore one is nice, it allows you in install apps from the Microsoft store. I imagine that for a lot of readers, that’ll be the primary — if not only — way they’ll interact with it.

Usage

winget can be accessed via Powershell, or via the good ol’ cmd prompt.

Whichever option you choose, I recommend using the Windows Terminal to access that shell.

To search for an application, you can use (part of) its name after the search command. Here, I want to know if winget has a popular video player, vlc:

If a result shows up, it’s available for download using winget ! If you like, you can look at the manifest file for a package:

Installing it can be done via the install command:

While winget install vlc would have worked here, I opted to be more specific and use the id the show command returned.

The -i flag is shorthand for —interactive . It will pop up the visual installer, the kind many people know and love despise.

searching, showing, and installing the VLC package

To get a list of all applications that are currently installed:

Uninstalling programs supports packages that weren’t installed by winget too. I grabbed the id for 7-zip from the winget list output. Then, I uninstalled it using that id:

Both the list , and uninstall commands are experimental features, and need to be enabled via the settings first.

A graphical interface

Winstall is a website that shows the info in those manifest files. It allows you to select the programs you want to install, and generates the appropriate line to enter in the command line.

In the following snippet, I install 7-zip, Firefox, and AIM via winget using powershell.

winget also works via cmd . The site provides the option to display the command for that shell instead. There the ; to seperate commands would be replaced by && :

If you’re uncomforable entering that line into the appropriate shell, the site provides the option to download a .ps1 or .bat file. Running that will execute that command for you via respectively powershell or cmd.

Name already in use

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

  • Go to file T
  • Go to line L
  • Copy path
  • Copy permalink
  • Open with Desktop
  • View raw
  • Copy raw contents Copy raw contents

Copy raw contents

Copy raw contents

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.

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

search command

The following arguments are available.

Argument Description
-q,—query The query used to search for an app.
-?, —help Get additional help on this command.

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

Option Description
-m, —manifest 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.
—id Limits the install to the ID of the application.
—name Limits the search to the name of the application.
—moniker Limits the search to the moniker listed for the application.
-v, —version Enables you to specify an exact version to install. If not specified, latest will install the highest versioned application.
-s, —source Restricts the search to the source name provided. Must be followed by the source name.
—scope Select install scope (user or machine)
-e, —exact Uses the exact string in the query, including checking for case-sensitivity. It will not use the default behavior of a substring.
-i, —interactive Runs the installer in interactive mode. The default experience shows installer progress.
-h, —silent Runs the installer in silent mode. This suppresses all UI. The default experience shows installer progress.
-o, —log Directs the logging to a log file. You must provide a path to a file that you have the write rights to.
—override A string that will be passed directly to the installer.
-l, —location Location to install to (if supported).
—force Override the installer hash check.

The following example installs a specific version of an application.

The following example installs an application from its Package Identifier.

The following example installs an application by version and ID.

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:

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

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>

Option Description
-m, —manifest The path to the manifest of the application to install.

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

Использование менеджера пакетов WinGet в Windows 10 и 11

date09.12.2021
useritpro
directoryPowerShell, Windows 10, Windows 11
commentsкомментариев 18

В Windows 10 и 11 появился собственный встроенный менеджер пакетов WinGet (Windows Package Manager), который можно использовать для установки приложений из командной строки (по аналогии с пакетными менеджерами Linux, например yum, dnf, apt и т.д.).

WinGet.exe это консольная утилита, которая позволяет упростить установку программ в Windows. Благодаря winget, вам не нужно искать официальные сайты, скачивать установочные файлы, и устанавливать программы вручную. С помощью Windows Package Manager вы можете установить любую программу из репозитория с помощью всего одной команды.

Установка менеджера пакета WinGet в Windows 10

Менеджер пакетов WinGet можно установить в Windows 10, начиная с билда 1709. В актуальных билдах Windows 11 21H2 и Windows 10 21H1 winget уже встроен в образ.

Чтобы проверить, установлен ли winget на вашем компьютере, откройте консоль PowerShell и выполните команды:

Get-AppPackage *Microsoft.DesktopAppInstaller*|select Name,PackageFullName

В нашем случае winget (имя UWP приложения Microsoft.DesktopAppInstaller) установлен.

проверить, что Microsoft.DesktopAppInstaller установлен

Вы можете установить WinGet через Microsoft Store (там он называется App Installer) по ссылке https://www.microsoft.com/en-us/p/app-installer/9nblggh4nns1#activetab=pivot:overviewtab

установка winget (App Installer) через магазин Windows 10

Также вы можете установить winget вручную через PowerShell (если вы удаляли предустановленные приложения). Для этого нужно с помощью PowerShell скачать msixbundle файл winget с GitHub (https://github.com/microsoft/winget-cli/releases) и установить его (на момент написания статьи доступна версия Windows Package Manager v1.1.12653):

Invoke-WebRequest -Uri «https://github.com/microsoft/winget-cli/releases/download/v1.1.12653/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle» -OutFile «C:\PS\WinGet.msixbundle»
Add-AppxPackage «C:\PS\WinGet.msixbundle»

установка winget в windows 10 из appxbundle

Также можно скачать и установить пакет WinGet вручную:

ручная установка winget в windows 10

Проверьте установленную версию winget командой:

версия winget

Основные команды winget:

  • winget install <пакет> — установка пакета
  • winget uninstall <пакет> — удаление пакета
  • winget upgrade – обновление пакета программы
  • winget list – вывести установленные пакеты
  • winget show < пакет > — показать информацию о пакете
  • winget source < опции > — управление репозиториями пакетов
  • winget search < поисковая строка > — поиск пакетов в репозиториях
  • winget export – экспорт списка установленных программ в файл
  • winget import – установка программ (пакетов) по списку в файле
  • winget hash < пакет > — получить хэш установщика пакета
  • winget validate < пакет > — проверить файл манифеста

параметры команды winget

Настройки winget хранятся в файле settings.json (в «C:\Users\%username%\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState»). Вы можете изменить настройки Winget с помощью команды:

Установка программ в Windows с помощью WinGet

Для установки программ с помощью менеджера пакета WinGet используются онлайн репозитории. Их список можно вывести командой:

winget source list

По умолчанию в WinGet доступны два официальных репозитория WinGet:

  • msstore (https://storeedgefd.dsx.mp.microsoft.com/v9.0) репозиторий Microsoft Store
  • winget (https://winget.azureedge.net/cache) репозиторий программ, поддерживаемый Microsoft

Прежде чем установить программу из репозитория WinGet, нужно узнать имя пакета. Для поиска пакетов используется команда search. Например, чтобы найти zip архиваторы во всех доступных репозиториях, выполните команду:

winget search zip

winget search zip -s msstore

Команда вернет список пакетов (с названиями и версиями), соответствующих вашему запросу. Обратите внимание на столбец Source. В нем указан репозиторий, в котором найден пакет.

поиск в репозитории winget search

Можно получить информацию о конкретном пакете:

winget show 7zip.7zip

вывести информацию о пакете в репозитории winget

В репизитории может хранится несколько версий пакета, чтобы показать список доступных версий пакета, выполните:

winget show 7zip.7zip —versions

Например, вы хотите установить архиватор 7zip. Скопируйте его имя или ID и выполните команду установки:

winget install 7zip.7zip

установка программы в WIndows командой winget install

По-умолчанию устанавливается последняя доступная версия программы. Можно установить определенную версию пакета:

winget install 7zip.7zip -v 21.05

Как вы видите, менеджер пакетов WinGet автоматически скачал и установил приложение. Всего одной командой. Программа появилась в списке установленных программ в стартовом меню Windows.

7zip успешно установлен

Теперь установим, например, Windows Terminal и VSCode для написания PowerShell скриптов:

Сначала ищем имена пакетов:

winget search terminal
winget search «visual studio»

Затем устанавливаем их по очереди:

winget install Microsoft.WindowsTerminal –e ; winget install Microsoft.VisualStudioCode –e

Если вы хотите запустить установку пакета программы в фоновом режиме, используйте параметр —silent :

winget install «VLC media player» —silent

При установке некоторых программ можно автоматически принять условия использования. Например, при установке набора утилит sysinternals:

winget install sysinternals —accept-package-agreements

По умолчанию программы устанавливаются на системный диск в каталоги Program Files. Вы можете изменить каталог установки программы:

winget install microsoft.visualstudiocode —location «D:\Programs»

Winstall – графической интерфейс для менеджера пакетов WinGet

Пользователи, которым некомфортно работать в командной строке winget, могут использовать веб-сервис Winstall (https://winstall.app/). Winstall представляет собой графический интерфейс для репозитория WinGet (для установки доступно более 2900 программ).

С помощью сервиса Winstall можно сгенерировать скрипт установки нужных вам программ. Найдите программы в репозитории и нажмите + для добавления их в скрипт установки.

Winstall - графический веб интерфейс для менеджера пакетов winget

Затем нажмите на кнопку Generate Script и сервис сформирует для вас команду установки выбранных приложений.

Скопируйте код со вкладки Batch или PowerShell и вставьте его соответственно в cmd.exe или PowerShell консоль.

скрипт установки программ через winget

Так, с помощью всего одной команды вы можете установить необходимые вам программы.

WinGet: Обновление и удаление программ в Windows

WinGet позволяет не только устанавливать программы, но и обновлять или удалять их. Для вывода списка установленных программ на компьютере выполните:

Команда выведет полный список программ, установленных на компьютере (включая программы, установленные не через winget). Если для программы доступно обновление, в столбце Available будет указана новая версия.

Winget list список установленных программ

Для обновления приложения, установленного через winget, выполните команды:
winget upgrade —id 7zip.7zip

Можно обновить сразу все установленные программы:

winget upgrade —all

Для удаления программ используется команда:

winget uninstall —name 7zip.7zip

Вы также можете удалить приложения, установленные не через WinGet по их ID:

Экспорт и импорт установленных приложений на другие компьютеры

С помощью WinGet вы можете экспортировать в JSON файл список приложений, установленных на компьютере и затем использовать этот файл для быстрой установки того же набора приложений на другом компьютере.

Для экспорта списка приложений в файл, выполните:

winget export -o c:\ps\installedapps.json —include-versions

Файл содержит список программ, установленный через Windows Package Manager.

экспорт/импорт установленных приложений winget в текстовый json файл

Чтобы установить список программ из json файла на другом компьютере, выполните команду:

winget import -o .\installedapps.json

Можно указать, чтобы менеджер пакетов игнорировал версии и недоступные программы при установке, нужно добавить параметры —ignore-unavailable и —ignore-versions .

Предыдущая статьяПредыдущая статья Следующая статья Следующая статья

page

page

page

alt=»блокировка IP адресов правилами брандмауэра» width=»58″ height=»56″ /> Защита RDP от подбора паролей с блокировкой IP правилами Windows Firewall
Когда истекает пароль пользователя в AD, оповещаем пользователей о необходимости сменить пароль
alt=»установка hyper-v server» width=»58″ height=»56″ />Установка и настройка Windows Hyper-V Server 2019 (2016)
alt=»Вам понадобится новое приложение, чтобы открыть эту ссылку WindowsDefender» width=»58″ height=»56″ />Вам понадобится новое приложение, чтобы открыть эту ссылку Windows Defender

Зачем если есть choco? Притом и апдейты пакетов есть. И версионность и гуй к нему, и репозиторий поднять можно хоть на нексусе, хоть на iis, да хоть из локальной папки или шары.

Windows оно свое родное, встроенное, + update будут приходить на него. MS сможет статистику по устанавленому софту вести

В винде был / есть nuget(oneget) еще очеееень давно. Но развивалось это крайне хреново. Кстати choco это обязка над нугетом. Но сделана намного лучше. И она кстати тоже может тянуть апдейты и даже ветка энтерпрайз есть. Да встроенные средства это хорошо, но у майков явно приоритет был направляен на Ажур. Поэтому многие классные идеи реализованы абы как

а как в таком случае снимать чекбокс, что бы не ставились говнобраузеры и прочий мусор?

А никак, всё включено :).

А у меня не запускается winget из консоли запущенной от Администратора.
Вот аналогичная проблема, но кругом только костыли.
https://github.com/microsoft/winget-cli/issues/637

Может кто-то рабочее нормальное решение знает?

Майки как всегда по своему все сделали, не умеют они в консоль….

winget upgrade —id 7zip.7zip — зачем тут ключ —id,
winget uninstall —name 7zip.7zip — зачем тут ключ —name
Более того, почему при апгрейде ключ —id, а в анинсталле —name, какой смысл в этом…Я понимаю что можно обратиться к ID пакета по его «хешу»:
winget uninstall —id «<0F693AA3-4387-4ACB-A6FD-3A396290587>» тут есть логика, так пусть она и остается тут, хотя и тут ключ —id все равно лишняя информация.

winget install —id=Notepad++.Notepad++ -e ; winget install —id=Microsoft.Teams -e ; winget install —id=Mozilla.Firefox -e — То есть перечислением без ключей и знаков препинания как APT/YUM — вингет не может, нужно чередовать команду полностью… Зачем?

winget install —id=Notepad++.Notepad++ -e — Опять набор херни, почему не определять вот так: «winget install notepad++» и тому подобное(понятно что там каталогизировано по типу как портов во фряхе, только по названию издателя, а не направлению, но можно же и упростить местами, тот же Microsoft.Teams как msteams)

winget install —id=Adobe.Acrobat.Reader.64-bit — зачем указывать разрядность, почему не ставить сразу на основе разряда ОС. А вот если тебе на х64 нужен х32 пакет, то тогда явно указывать. Заморочено опять же. Так как в х32 не поставить х64, а наоборот можно, тогда какой смысл это делать для х64, если это логично. Я понимаю, иногда нужна конкретная библиотека в х64 от х32….Но акробат не библиотека….

Это похоже на претензию о том, что в PowerShell имена командлетов длинные (как будто бы нет autocomplite, а запоминать короткие команд, которыми пользуешься раз в полгода будто бы легче, чем словосочетания, близкие к человеческому языку). ��

Мне кажется, чем больше способов уточнить параметры — тем лучше.
Если на свой комп ставить софт — это, условно, «раз в пятилетку» — пяток лишних символов набрать не проблема.
А если не на свой и не раз в пятилетку — наверняка будет скрипт, то есть, опять сводиться к «пяток лишних символов».

Winget существует полтора года только, но уже сейчас существует 3 дистрибутива Notepad++, которые он находит.
И команда «winget install Notepad++» ожидаемо приводит к вопросу «А какой именно Notepad++ вам поставить?».

То есть, запустил я установку штук 20 программ и пошел ужинать. Возвращаюсь, и начинаю изучать, а где же там по короткому имени е удалось определить автоматом, какой дистрибутив выбрать…

)))) да-да-да, запустили вы шт 20 программ и пришли после ужина к разбитому корыту… ибо ни чего не встало
а не встало из-за дурацкой особенности winget требовать админа после каждого пакета, а не разово вначале и помнить до конца установки….
Т.е. мы сидим и курим перед монитором час пока он каждый пакетик скачает поставит и займется следующим, а если вовремя не подтвердили админские права, то вообще прервет установку
я конечно могу ошибаться, но собственно за этим и открыл данную статью, чтобы найти как же это гуано обойти, а не сидеть и не ждать как он каждый пакет качает, чтобы после каждого вводить пароль

Запрос «прав администратора» — он же для того, чтобы не позволять приложениям запускаться с повышенными привилегиями незаметно.
А если это осознанный запуск пачки инсталляторов — можно запустить оболочку, откуда будет вызываться winget с повышенными правами и идти спокойно ужинать. ��

Во первых причем тут павершел и вингет, а во вторых пример тут твой не к месту совсем, у вингета нет автокомплита от слова совсем, плюс пяток лишнего там, пяток лишнего тут, вот и получается х**та а не «пакетный менеджер». Классика от майков. Нужно упрощать, а не вот это вот все. Никаких уточнений не требуется делать, если ты тупо ставишь пакет. Если ты хочешь специфический вариант, будь любезен топай и собирай ручками, ну или выбирай доп параметры. Если для тебя это прозрачно, если тебе это все норм, запоминать в какой параметр где и когда и при каких условиях ставится ключ, при том что они делают одно и тоже, как например winget upgrade —id и winget uninstall —name, где id и name это одно блин и тоже, то для меня это только отталкивающий фактор. Про пятилетку и чаще чем в пятилетку: ты же судишь по себе, если ты «раз в пять лет» юзаешь вингет то это твой опыт, не надо накладывать его на других как правду в последней инстанции.

Я только сейчас понял, что в комментарии выше было обсуждение примеров из статьи, а не самого winget.
Делать выводы о том инструмент работает ТОЛЬКО так как описано в статье — ну это, говоря прилично, странно.
Тем более, это обзорная статью. по сути: чем больше примеров различных параметров будет показано — тем лучше.

Что же касается Winget:
— Можно так: winget install Todoist
— Можно так: winget install -name Todoist
— Можно так: winget install —id Doist.Todoist
Как видно, name и id — разные вещи. И «лишние» параметры указывать необязательно, когда ситуация однозначная.
Но вот сделать winget install «Python 3» нельзя, так как пакетов с именем «Python 3» будет два. Но у них разный ID и я могу сделать так:
winget install Python.Python.3 — без параметр —id. И winget «сам разберется», что я имел в виду «winget install —id Python.Python.3»
Тоже самое касается и конкретного примера из комментария выше — winget install Notepad++ приводит к запросу «а какой именно из этих доступных пакет Вам нужен?»

Что касается winget install —id=Adobe.Acrobat.Reader.64-bit — А как должно быть? Все должны дружно договорить или Microsoft должна всех убедить? Или стандарт какой навязать?
Есть пакет «Adobe Acrobat Reader DC» (из магазина, ID — XPDP273C0XHQH2), если ставить его на x64 — winget ставить x64. Как он ведет себя на x32 — не проверял.
А ещё есть пакет «Adobe Acrobat Reader DC» (ID — Adobe.Acrobat.Reader.32-bit), который явно 32-х битный и к нему в пару есть «Adobe Acrobat DC (64-bit)» (ID — Adobe.Acrobat.Reader.64-bit).
Мне такое именование тоже не нравиться, но это вопросы к этому парню, а не Microsoft.

То есть из всего комментария случайно получилось одно дельное замечание — нельзя ставить несколько пакетов одной командой. Issue висит на GitHub уже полтора года, да.

P.S. — Про «раз в пять лет» — да, это мой опыт, безусловно. Но массовая (пере)установка ПО — это похоже на случай свежей установки ОС. Так уже часто это случается? Если это разовая установка какой-то программы/компонента/библиотеки, которая раньше не нужна была, но потом понадобилась, то все равно начинать с команды «winget search имя_пакета». И тут снова — пяток лишних символов не должен быть проблемой.

P.P.S — PoweShell был упомянут только из-за того, что претензии к именованию командлетов и функций обычно примерно такие же — «я пишу короткие команды каждый день и уже их выучил, а тут в пример вон какие длинные — зачем все это лишнее печать, можно же было проще?». К Winget он никак не относиться. Просто претензии забавны и очень похожи.

Чтобы установить список программ из json файла на другом компьютере, выполните команду:

winget export -o .\installedapps.json

Разве не import должен быть?

admin: верно, исправлено

)))) да-да-да, запустили вы шт 20 программ и пришли после ужина к разбитому корыту… ибо ни чего не встало
а не встало из-за дурацкой особенности winget требовать админа после каждого пакета, а не разово вначале и помнить до конца установки….
Т.е. мы сидим и курим перед монитором час пока он каждый пакетик скачает поставит и займется следующим, а если вовремя не подтвердили админские права, то вообще прервет установку
я конечно могу ошибаться, но собственно за этим и открыл данную статью, чтобы найти как же это гуано обойти, а не сидеть и не ждать как он каждый пакет качает, чтобы после каждого вводить пароль

просьба удалить — коммент не прикрепился к сообщению на которое отвечал

Посмотрел на это поделие — всё как всегда, идея хороша, реализация из рук вон плохо, если хоть немного работал в Linux — смотреть на этот кошмар невозможно. Может быть, когда-то и станет получше, но, зная как МС работает с подобными проектами — надежда очень слабая. Тот же Chocolatey выглядит гораздо привлекательнее.

Читать:
Как добавить отзывы на сайт

Related Posts