OneGet is to Windows what apt-get and yum are to Linux.
Back in April of this year, Jeffrey Snover from the Windows Server team, teased the power of a new package management program coming to Windows called OneGet.
The beauty of OneGet is that it gives you access to over 2,300 software packages directly from the command line. There’s no need to visit the stupid Microsoft Store or sift through Google search results. You can now install hundreds of packages directly from the Powershell command line with ease.
Moreover not only let’s you install and uninstall packages with simple commands but you can also easily search through repositories so you can grab exactly what you need.
It’s really a beautiful thing and today I’m going to show you how to use it.
Here’s how to get started.
Fire up Windows 10, kick open PowerShell and type:
Import-Module -Name OneGet
After a few seconds the command prompt will return awaiting your input.
So what can we do with OneGet?
We’ll lets list the command and see!
Get-Command -Module OneGet
The first thing we need to do is add a monster software repository called Chocolatey.
Adding Chocolatey to OneGet
By default you’ll only see the PSGallery and MSPSGallery repos but these guys are very limited. SO we need the delicious chocolatey repo. And I mean – with a name like “chocolatey” who can resist it?
If you search the web you’ll see a few people using the Add-PackageSource cmdlet to add the Chocolatey repository. But in the Windows 10 Technical Preview, Add-PackageSource was actually replaced with Register-PackageSource so that’s what I’m using.
Here’s the command we need to use to add the Chocolatey repo into OneGet:
Register-PackageSource -Name chocolatey -Location http://chocolatey.org/api/v2 -Provider PSModule -Trusted -Verbose
Now we can have some serious fun.
First, head on over to chocolatey.org/packages to see all the packages at your disposal.
Let’s say I want to install Google Chrome. I can search for it:
Find-Package -Name Chrome
Or just install it like so:
Install-Package -Name GoogleChrome
Try experimenting with different package names. For example put in:
- Install-Package -Name VLC
- Install-Package -Name Firefox
- Install-Package -Name flashplayerplugin
You can also easily uninstall programs with the Uninstall-Package cmdlet.
The Bottom Line
There’s got to be a way to list packages from the command line but I haven’t figured that out yet. If you know please share in the comments.
Also, although I can easily install and uninstall packages, I haven’t found an Update-Package cmdlet. This would be extremely useful and I hope Microsoft considers adding it.
So what do think about OneGet? Will Microsoft use this as a way to install ModernUI Apps?
I personally don’t see that happening because this tool is better suited for Powerusers but I guess the possibility is there. Let me know what you think in the comments below!