Microsoft’s new Windows Package Manager, which makes it easy to install applications by running a command. Here’s how to try the new command winget and why this Linux-style package manager is so exciting for the future of Windows 10.
What is Windows Package Manager?
Package managers are very popular on Linux. Instead of searching for an app on the web, downloading an installer, and clicking through a wizard, you can simply run a quick command to search for and install an app by its name.
For example, to install Microsoft PowerToys, you can open a Terminal window and run the command:
winget install powertoys
The command will automatically find, download, and install the software with no additional input from you. Very easy!
Microsoft is hosting its own software repository, and other organizations and individuals can do the same. This is an important feature that improves productivity on Linux, especially for developers and system administrators.
Right now, this tool is only available to developers, but one day Microsoft or third-party developers may create an easy-to-use graphical tool that quickly finds and installs. place applications. It might look like the Windows Store, but with access to a whole bunch of Windows desktop apps that people actually use. In other words, it’s like Chocolatey, but built into Windows.
What is winget?
The winget command-line tool allows developers to discover, install, upgrade, remove and configure applications on Windows 10 computers. This tool is the client interface for the Windows Package Manager service.
The winget tool is currently in preview, so not all functions are available at this time.
How to install winget
There are several ways to install the winget tool:
Note: The winget tool requires Windows 10, version 1809 (10.0.17763) or a later version of Windows 10.
– Installer behavior may vary depending on whether you are running winget with admin privileges.
– When running winget without admin rights, some apps may require upgrade permission to install. When the installer runs, Windows will prompt you to change permissions. If you choose not to upgrade to admin rights, the app will fail to install.
– When running winget in Command Prompt with admin rights, you won’t see a prompt to upgrade permissions if the application asks for it. Always use caution when running CMD as admin and only install applications that you trust.
How to use winget – the new Windows package manager
You can run winget from Windows PowerShell or the classic Command Prompt environment. The article recommends that you install a new Windows Terminal if it is not already available.
From a command line, run the winget command to see more information on how to use the tool.
To search for an application, run the following command, replacing “name” by search term:
winget search name
To install an application, run the following command, replacing “name” by the name of the application:
winget install name
To view more information about an application, run the following command, replacing “name” by app name or search term:
winget show name
To see the full list of available applications, run the following command:
In addition to install and search, winget provides several other commands that allow you to display application details, change sources, and validate packages. To get the full list of commands, type:
In the first version, the repository of winget has integrated many popular desktop applications. You’ll find everything from popular Windows apps to developer tools. This list includes Google Chrome, Mozilla Firefox, Zoom, Steam, VLC Media Player, Spotify, Windows Terminal, Visual Studio Code, Ruby, Microsoft PowerToys, etc..
To manage the source, run the command:
You will see a list of commands. For example, to see the current sources, run:
winget source list
In the initial version of winget, there was only one built-in winget source operated by Microsoft, located at:
In the future, you will be able to add third-party sources with the command:
winget source add
You can get more information about using one of winget’s built-in commands by adding -? comes with it. For example, to see the different options you can use with winget, run the following command:
winget search -?
The current preview of the winget tool supports the following commands:
|export||Export the list of installed packages.|
|features||Shows the status of experimental features.|
|hash||Generate a SHA256 hash for the installer.|
|import||Install all packages in one file.|
|install||Install the specified application.|
|list||Show installed packages.|
|search||Search for an app.|
|show||Show details for the specified application.|
|source||Add, remove, and update Windows Package Manager repositories accessed by the winget tool.|
|validate||Validate the manifest for submission to the Windows Package Manager repository.|
|uninstall||Uninstall the given package.|
|upgrade||Upgrade the given package.|
The current preview of the winget tool supports the following options:
|-v, –version||Returns the current version of winget.|
|–info||Provides you with all the details about winget, including links to licenses, privacy statement, and configured group policies.|
|-?, –help||Shows additional help for winget.|
Supported installer formats
The current preview of the winget tool supports the following types of installers:
Create a winget script
You can create bath scripts and PowerShell scripts to install multiple applications.
@echo off Echo Install Powertoys and Terminal REM Powertoys winget install Microsoft.Powertoys if %ERRORLEVEL% EQU 0 Echo Powertoys installed successfully. REM Terminal winget install Microsoft.WindowsTerminal if %ERRORLEVEL% EQU 0 Echo Terminal installed successfully. %ERRORLEVEL%
Once scripted, winget launches the applications in the order specified. When the installer returns success or failure, winget launches the next installer. If the installer launches another process, it will probably fall back to winget soon. This will cause winget to process the next installer before the previous one completes.
Microsoft will definitely add additional features to Windows Package Manager in the future and the tool will become more and more powerful.
Source link: How to use winget – New Package Manager for Windows 10