≡ Menu

What is chocolatey in PowerShell v5?

Microsoft released PowerShell v5 Preview yesterday. I did quick search on internet about what is special about this release. Though I couldn’t find any exiting articles, the one that grabbed my attention is OneGet module.

What is OneGet module and what it has?

Get-Command -Module oneget
chocolety1

So basically, it is a module that allows packaged software installation from a web based sources like chocolatey in a silent manner. That means, you can use these cmdlets to install, uninstall softwares available at Chocolate (a web based software repository for Windows OS).

When I ran Get-PackageSource to get the list of sources, it gave me below message. Looks like it needs some base component (NuGet Manager in this case) to install any packages from sources. So, I let this installation continue. It completed quick as I see some progress like it is downloading packages from a web URL.

chocolety

After download and installation, I can see Chocolatey as one of the package source. My assumption is we can have any no. of package sources here if one is available.

chocolety2

Ok, well, I have the package source, what next? Its time to install a software. Per the Chocolatey website, they have  1739 packages available for installation on Windows. We can get these details using one of the available cmdlets, Find-Package, as well.

(Find-Package).Count

If you want to search for any softwares, you can do that as well with this cmdlet. Vim is one of my favorite editors. So searched for this package and I got the list.

Find-Package | ? {$_.Name -match "vim" }

chocolety3

Out of the returned list, the one I want to install is VIM. So let us see how we can install this package.

Install-Package is the cmdlet that can be used for package installation. It can accept either Name or Package object to install the software.

Install-Package -Name Vim

chocolety4

As you can see in the above screen package installation is progressing by downloading the content from internet. Now we can verify the installed packages using Get-Package cmdlet.

Uninstallation of these packages is also straight forward using Uninstall-Package cmdlet.

Boe Prox has written a similar article on this automated & silent package installation using OneGet and his explanation is much deeper. You can have peek at his blog post http://learn-powershell.net/2014/04/03/checking-out-oneget-in-powershell-v5/ for more details

Conclusion:

In general, I found this module and installation via a centralized source via web quite useful. Home PC users might like this but when it comes to enterprise usage, I doubt how far the firms will use this because the packages are maintained by a third party on the web. May be if similar sources can be built in house  easily and package installation, uninstallation can be done easily, then I am sure it will become a quite useful tool for any enterprise for managing softwares.

Hope this review helps.