Side-Quest: Get Started with Winget

Introduction

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.

winget default output

Search

Now we can move on to search packages from the Microsoft community repository. Let’s search for the GitHub CLI.

winget search output

Install

Great, we found it! We’re just one command away from installing it.

winget install GitHub.cli

winget install output

Export and Import

The winget cli makes it incredibly easy to setup a new machine thanks to the export and import commands.

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.

Summary

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s