Tuesday, June 25, 2019

Package management... In Windows?




You read that title right! There are package management capabilities for Windows! Within the operating system, Microsoft integrated what was once known as OneGet back in PowerShell 5.0. But wait, there's more! There is a third party tool and package repo that includes many applications that would normally be sourced from multiple websites called Chocolatey. For those who may be familiar, the open source community has had several utilities for some time, such as apt-get or yum. Package management allows for the distribution of applications and configuration settings in a programmatic manner. I have been known to say, "If you will have to do it more than twice, automate it!".

A bit of personal history. I have spent a lot of time during my career in EUC and endpoint management. Through this, I have attended InstallShield (Macrovision) training, used tools such as InstallShield Admin Studio, Wise Package Studio, WinZip Self-Extractor, Novell ZENworks Suite, Microsoft Group Policy, Microsoft SCCM and various script techniques to implement application and workstation lifecycle solutions for several large enterprises and adapted these methods to the individual and small business. So when I learned about this tool, of course, I was enticed to know more.



With package management, you can...

  • Manage a list of software repositories in which packages can be searched, acquired, and installed
  • Search and filter your repositories to find the packages you need
  • Seamlessly install and uninstall packages from one or more repositories with a single PowerShell command


Per GitHub -

"PackageManagement is supported in Windows, Linux and MacOS now. We periodically make binary drops to PowerShellCore, meaning PackageManagement is a part of PowerShell Core releases. Also PackageManagement and PowershellGet Modules are regularly updated in PowerShellGallery.com."

"OneGet is shipped in Win10 and Windows Server 2016! For downlevel OS, you can install the WMF 5.1 and then start using the OneGet."

What is PackageManagement (OneGet)?

OneGet is a Windows package manager, renamed as PackageManagement. It is a unified interface to package management systems and aims to make Software Discovery, Installation, and Inventory (SDII) work via a common set of cmdlets (and eventually a set of APIs). Regardless of the installation technology underneath, users can use these common cmdlets to install/uninstall packages, add/remove/query package repositories, and query a system for the software installed.


As shown in this image, there are many providers and sources currently available. The PowerShell gallery is a growing collection of modules and code while another, Chocolatey, has quickly become a mainstay for application acquisition.

Per Chocolatey -

Think of Chocolatey as a framework that you can build on top of. Chef, Puppet, Boxstarter, PowerShell DSC, Ansible, Saltstack, etc all have ways for using Chocolatey to ensure the state of a computer and packages installed. Even Microsoft has decided to use Chocolatey's framework with the PowerShell PackageManagement / OneGet package manager aggregator! See Jeffrey Snover's post for more information.

Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.

Chocolatey is a single, unified interface designed to easily work with all aspects of managing Windows software (installers, zip archives, runtime binaries, internal and 3rd party software) using a packaging framework that understands both versioning and dependency requirements. Chocolatey packages encapsulate everything required to manage a particular piece of software into one deployment artifact by wrapping installers, executables, zips, and scripts into a compiled package file. Chocolatey packages can be used independently, but also integrate with configuration managers like SCCM, Puppet, and Chef. Chocolatey is trusted by businesses all over the world to manage their software deployments on Windows. You’ve never had so much fun managing software!


I highly recommend familiarizing yourself with this capability as it will save you a lot of time building and deploying in your environment! I also thank the PowerShell and Chocolatey teams for their efforts for these capabilities.