[MUSIC]
Hi, everybody. I'm Demitrius Nelon.
I'm a Product Manager at Microsoft.
I'll be talking to you today about the Windows Package Manager.
We've recently come out with version 1.0.
I'll be sharing some of the tips and tricks
and covering some more things in detail.
I'll give you a little bit of an overview on
what a package manager is.
It's a tool that's going to help you
install and upgrade software on Windows.
It's got some advanced features like being able to export
the packages on your machine and import them onto another one.
One of the most common questions we get is,
is this the same thing as winget?
Simple answer is yes.
The tool is actually Windows Package Manager,
but the application that you run is winget.
Your first question is likely to be,
how do I install this?
You can go to our GitHub repository.
You can find the instructions for installing the client.
We also have an insider program you
can sign up for if you want to get Dev builds.
Or if you're running a Windows Insider build,
you'll automatically get Insider builds
of the package manager as well.
Let's go into some of the basic functionality here.
First thing you're going to want to be able to
do is search for packages.
We have the winget search command for that.
I'll do a quick search for Windows Terminal.
What you'll see is a couple of results.
You'll see the stable version and the preview.
I've also enabled autocomplete with
PowerShell so I can save a little bit of typing here.
If I type winget i and hit Tab,
you'll see the install command will complete.
I'm going to go ahead and copy and
paste the Windows Terminal Preview here.
If I do -v, I'm looking for versions.
One of the nice things here is I can actually tab through.
You'll see this is the latest version that's displayed.
If I tab one more time,
you'll see an older one.
I'm going to go ahead and install this older version so that
I can demonstrate the upgrade capability for you.
The package manager's gone out,
it's checked the metadata,
it's downloading the program,
verified the hash, and it's installed it.
Now, if I do the list command,
you'll be able to see everything that's installed on my system.
Not just things that were installed with
the Windows Package Manager,
but you can see I've got Windows Terminal Preview here.
Now, the next thing I'm going to show you is upgrade.
I do upgrade by itself.
It's going to give me a list of packages that can be upgraded.
One of the conveniences is you can do winget
upgrade dash, dash all to upgrade everything.
But for this one, I'm just going to upgrade Terminal Preview.
You'll see we'll do the same thing again.
We'll go out, we'll download the latest version,
we'll check the hash to make sure it's good,
and we'll get that installed.
After this is done,
I'll go ahead and show you what uninstall looks
like and we'll verify that with list again.
The command is pretty much what you'd expect,
winget uninstall Windows Terminal Preview.
We'll run the uninstaller and that'll remove it from the system.
Now, when I look at the list,
you'll see that I still have Windows Terminal,
but you'll see that I don't have Windows Terminal Preview.
The other thing that's nice is you can actually uninstall
things even if they were not
installed by the Windows Package Manager.
I'll uninstall the Xbox Game Bar plug-in as an example.
You'll be able to see that that's now been removed as well.
Now, I'll cover a couple more of the advanced features here.
One of the things you can do with a package manager is
we've got a set of feature toggles that we can use.
You can use the winget features
command to see what's enabled or disabled.
Right now, you can see I've got the store enabled.
I'm going to show you how to go into settings,
and control those, and look at a few other things.
When I run winget settings,
it's going to launch my default JSON editor.
In this case, I have Visual Studio Code configured.
You'll see right now, this is how I'm
getting the rainbow progress bar.
Here's that experimental feature.
I'm going to set that to false.
You'll notice I'm getting some IntelliSense here,
that's coming from the JSON schema.
I'm going to go ahead and
look at the network downloader that's set to default,
which is delivery optimization.
That's actually something we do for enterprise customers.
I'm going to change my install behavior to a preference
for the scope of user for applications.
I could also set that to
machine if I want things installed machine-wide.
We also have the ability for you to set
a requirement rather than a preference.
A requirement just means that the package manager
must honor your requirement if it can,
and if it can't, then it's
not going to execute the command at all.
You can also specify things like
default locale and all of
that information is available in the schema.
I forgot to save the file.
Save it a little quick.
There we go. Now, you can see that I've
got the store is disabled.
The next thing I'm going to cover is
a really powerful feature for a lot of users.
They want to be able to figure out how do I move
the programs from one machine to another.
That's where winget export comes in.
I give it a JSON file to export those two.
You'll see a list of things spew out that didn't have a match.
These are just packages that are not
available in the community repository.
Since I don't have the storage source configured,
I'm also not getting matching from those.
Show you what that file looks like.
You'll see again it deviates on file with the schema and
you can see the programs that it was able to detect.
For this demo, I've got an import file on my desktop.
You can see what I have specified in here
is Screen to GIF and Mouse Without Borders.
They are a couple of programs I use pretty regularly.
By running import, it's going to go through all of
the packages in that file and install those on my system.
I get a little bit of UAC prompt as an interruption.
Once I accept that UAC prompt,
you'll see that'll continue going on.
If I would have run this in administrator mode,
I wouldn't have gotten that prompt,
things would have just installed as expected. There you go.
Now, let's talk about submitting a package.
If you go to GitHub,
you can see we've got a community repository,
and this is where all of the applications are
available from the default source come from.
We also do have the store source that was
mentioned earlier as an experimental feature,
and third-party organizations can
set up their own private repositories,
whether you're an enterprise or an ISV.
You'd go in, you'd modify YAML file.
You'd go through a submission process
where you create a pull request.
We've got all kinds of validation that happens that helps to
automatically make sure the app is
safe and then it installs correctly.
What I really wanted to cover today is
a tool that we've got called winget-create.
It's designed to help you to build a manifest
and to do upgrades for your applications.
What I'm going to show is the new function.
What you do is you pass in the URL to the installer.
It's going to parse it,
it's going to figure out as much of
the metadata as it can for you,
and then it's going to ask you a series of questions.
Now I've given it the URL for Ultimaker Cura,
which is a 3D printing slicing software.
I'm going to have to give it a fake name here because it's
going to tell me that it's already a duplicate if I don't.
I'm going to call it Cura.Cura.
But normally I would do something like Ultimaker.Cura,
followed what version the package is.
We're going to default to English.
I'm going to down arrow, this is an X64,
publisher is Ultimaker Cura.
This one uses a GPL license.
I'm going to copy and paste the description.
I'm going to skip on going into the optional fields,
there's quite a few of them.
But this is going to show you
exactly what the manifest looks like.
It's broken down all three files.
It's thrown in this lovely line for the schema
so that if you want to edit this in Visual Studio Code,
you get all the IntelliSense.
If I would have said yes there,
I could have made some additional changes.
On this one I can actually get it to submit the pull request.
I don't want to do that in this case since I did
a contrived package name.
That's going to be a fantastic tool to help you
to generate a manifest and submit a package.
You do the same thing if you were to do an update.
You'd be able to pass in the URL for the installer that
you want to submit and you'd also be able
to pass in the package name.
It would go ahead and download the manifest and
copy all of that rich metadata over for you.
The other thing that I was going to cover really
quickly is how long it takes to submit.
Normally when you're submitting a package to the repository,
we've got to go through and do all kinds of
scans and analysis on these things,
which is what you're seeing here with some
of these badges that they passed.
You'll see quite a few other things.
It typically takes about 30 minutes
for us to validate an application.
It can take a little bit longer than that,
possibly as long as another hour to publish,
but we do the publishing in batches.
You'll be able to get notifications
directly on your pull requests about
those and you'll be notified whenever they're
available for users in the repository.
Now let's talk a little bit about open source here.
This entire project is open source.
We are doing everything at GitHub.
We're very transparent.
One of the big things people ask is how they can contribute.
From our perspective it doesn't matter if you're writing code,
if you are fixing some documentation
where we've got some typos or something isn't complete,
or even if you're just giving us
some feedback and asking us for new features,
we see all of those things as valuable contributions.
I noticed a little bit earlier that I had been using
the WingetCreate tool and I
remembered that we're working on our new 1.1 schema,
so let me show you an example of
just how we would deal with a feature.
I've got a new feature request.
Let me use the template.
Make this issue for supporting that schema,
making sure that I'm acknowledging all of those things.
In this case, I'm not going to worry about
providing a technical implementation,
and the issue has been submitted.
We've got quite a few bots that we're
leveraging to do some things to help us out here.
One of the things you'll see is it's going to add
a Needs Triage label on this one. There it is.
I routinely go through or
somebody else from the team will go through.
We'll go ahead and mark that as "doesn't need
triage" that way we know that we've actually looked at it.
Since I created it, I've got
a pretty good idea what the ask is for this one.
People also want to know what's on the roadmap.
If you look here on the client repository,
I have gotten a filter,
so I'm looking for features and I'm
looking at things that have got the plus 1.
You can see right at the top,
we've got the ask for zip file support,
native PowerShell, store apps, and package dependencies.
We're actually working on package dependencies right now.
We're also working on
a new store source with our experimental feature.
We'll be releasing a draft pretty soon
for a specification on PowerShell,
and we've been doing some internal discussions
on how we're going to handle
zip and portable, standalone apps.
Something else and a lot of people aren't necessarily
aware of at Github is discussions.
This is a place where you can just come in
and you can ask questions,
you can get them answered,
or you can discuss ideas that you have without feeling like you're
committed to defining a full feature or submitting a bug.
Along that line,
you can also see when we're doing all of
the validation work in the packages repository,
you see all these labels here.
All of these things help with transparency and you'll see
some examples of these waivers being put in.
We've got a lot of different policies that we check in terms
of making sure that the language is appropriate,
making sure that the installers are
virus-free or at least as close to that as we can check,
and we go in and we put all of that information in.
Once your pull request has been approved,
if I can find one here getting lucky,
you'll also be able to see that we tell
the publisher when it was actually pushed
into the source and that it's
available for users to check
on their end to be able to install those packages.
That's a little bit of a snapshot on
how we're doing things on GitHub and open-source.
Like I said earlier,
we really highly value any of your contributions.
>> Thanks for joining us on Tabs versus Spaces.
It was great to hear from Demitrius
all about the Windows Package Manager.
You can find more information about Windows Package Manager by
visiting the documentation at docs.microsoft.com.
You can follow Demitrius on Twitter,
find announcements on the command-line blog,
or like Demitrius just shared,
go visit their repos, look through issues,
pull requests, participate in discussions,
as well as you can contribute
feedback at aka.ms/winget-feedback,
and right inside the winget command-line tool,
you'll find links to some of the associated documentation.
It was great to have you with us here on the
Tabs vs Spaces show, we'll see you next time.
[MUSIC]