For years, I’ve been installing and using the Chocolatey Package Manager for Windows to install and manage software. I created development environment setup scripts to take a new machine from first boot to code ready. I’ve been really happy with it.
However, after watching a Microsoft Build 2022 session I decided I should finally try
winget, a native package manager for Windows 10. This was first announced in preview at Build 2020, and now we’ve made it to the big version 1!
In this side-quest, we’ll install winget and then search for and install the GitHub CLI.
Let’s get started.
Install App Installer
Those running a Windows Insider build or in the Windows Package Manager insider group may already have the winget client installed. I’m not in either of these groups, so I installed the latest version of the Windows Package Manager from GitHub.
Thankfully, this is only temporary, as version 1 of Windows Package Manager will ship via automatic update for Windows 10 (version 1809 and later) soon.
Once App Installer has finished installing, open a new PowerShell window and type
winget. If the installation was successful, you will see the following output.
Now we can move on to search packages from the Microsoft community repository. Let’s search for the GitHub CLI.
Great, we found it! We’re just one command away from installing it.
winget install GitHub.cli
Export and Import
The export command will export a JSON file containing details of the apps you have installed. You can view the JSON schema here.
I created and backed up this file to setup new development environments later. It’s quick and easy to update! The import command imports the JSON file of apps to install.
I love having a native package manager for Windows 10. Soon, we’ll have this CLI available by default. Now is a good time to start moving toward winget, if you’re interested in doing so!
Stay tuned for the next post. Take care.