Winget
| Введение | |
| Установка | |
| Пример | |
| winget : The term 'winget' is not recognized as the name of a cmdlet… | |
| Failed when opening source(s); try the… | |
| Похожие статьи |
Введение
Windows Package Manager (также известный как winget) — это бесплатный менеджер пакетов
с открытым исходным кодом, разработанный Microsoft для Windows 10 и Windows 11.
Он состоит из утилиты командной строки и набора служб для установки приложений.
Независимые поставщики программного обеспечения могут использовать его в качестве канала
распространения своих пакетов.
Установка
Установлен по умолчанию на всех Windows 11 и Windows 10 начиная с 2004 (10 Мая 2020-го)
Самая старая версия Windows 10, на которую можно поставить winget это 1809 (Октябрь 2018-го)
Узнать версию вашей Windows можно выполнив команду
winver
Установить winget можно через Microsoft Store. Если он у вас открывается.
Второй вариант - установить скачав с
GitHub
Пройдите в
Releases → Windows Package Manager → Assets → Microsoft.DesktopAppInstaller_xxx.msixbundle
Список команд
Список команд можно получить выполнив
winget
Windows Package Manager v1.6.3482 Copyright (c) Microsoft Corporation. All rights reserved. The winget command line utility enables installing applications and other packages from the command line. usage: winget [<command>] [<options>] The following commands are available: install Installs the given package show Shows information about a package source Manage sources of packages search Find and show basic info of packages list Display installed packages upgrade Shows and performs available upgrades uninstall Uninstalls the given package hash Helper to hash installer files validate Validates a manifest file settings Open settings or set administrator settings features Shows the status of experimental features export Exports a list of the installed packages import Installs all the packages in a file pin Manage package pins configure Configures the system into a desired state download Downloads the installer from a given package For more details on a specific command, pass it the help argument. [-?] The following options are available: -v,--version Display the version of the tool --info Display general info of the tool -?,--help Shows help about the selected command --wait Prompts the user to press any key before exiting --logs,--open-logs Open the default logs location --verbose,--verbose-logs Enables verbose logging for winget --disable-interactivity Disable interactive prompts More help can be found at: https://aka.ms/winget-command-help
Пример
Пример установки PowerShell
winget install --id Microsoft.Powershell --source winget
Found PowerShell [Microsoft.PowerShell] Version 7.4.1.0 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.msi ██████████████████████████████ 103 MB / 103 MB Successfully verified installer hash Starting package install... Successfully installed
Ошибки
winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + winget search Microsoft.PowerShell + ~~~~~~ + CategoryInfo : ObjectNotFound: (winget:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Сам winget.exe может находиться, например в
C:\Users\Andrei\AppData\Local\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_0abcd1efghi
Эту директорию нужно добавить в PATH
$Env:Path += ';C:\Users\Andrei\AppData\Local\Microsoft\WindowsApps\Microsoft.DesktopAppInstaller_0abcd1efghi'
Failed when opening source(s); try the…
winget install --id Microsoft.Powershell --source winget
Failed when opening source(s); try the 'source reset' command if the problem persists. An unexpected error occurred while executing the command: 0x8a15000f : Data required by the source is missing
Add-AppxPackage -Path https://cdn.winget.microsoft.com/cache/source.msix
Автор статьи: Андрей Олегович
| Windows | |
| Terminal | |
| PowerShell |