Every mobile device has a store app that installs, removes and updates software according to the user demand. Windows and MacOS have their store too for almost a decade. The idea of using a package manager is derived from Linux OS, dpkg almost 25 years ago, but the first one that I’ve used was apt in back in 2000. Apt was not just a installing the package request from the repository but more importantly took care of the dependencies, in short made my life extremely easier in when Open Source was spreading and becoming popular.
Is there a package manager for Windows similar to Apt? Yes, Chocolatey.
And what about MacOs? Yes, there is Brew.
Configuration Manager and Package Managers
I’ve always thought that creating a SOE was always easier with Linux OS thanks to a kickstarter and package manager tool included in the distribution. Replicate the same infrastructure for Windows OS required at least WDS and WSUS Services and the only tool that leverage those services is MS SCCM (ConfigManager).
I think that SCCM is a very powerful tool, I admit that he does the heavy lifting of most of the boring stuff that every system administrator needs is accountable for. Indeed, that would be my first choice for an infrastructure that adopt Windows in every shape or form.
And for automation Powershell DSC and SCCM is in good company with Ansible, Chef, Puppet, SaltStack in alphabetical order just to name few of them the beauty of it is all these tool except SCCM have an Open Source version and a business version.
Chocolatey
Just looking at chocolatey, even not the business version (C4B), if you want to manage your own repository/distribution point you can do it with few simple steps. So the next step will be creating a list of desired applications (mozilla firefox, winrar, adobe acrobat, etc.. or create your own) or applications and installing/updating remotely with a script for all the workstation that you want to manage.
Remote SW installation with Chocolatey and Powershell
So using PowerShell and Chocolatey, if I want to install an 7zip on WORKSTATION1 :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#Remember to run PowerShell as an administrator #Connect to Workstation1 Enter-PSSession -ComputerName "WORKSTATION1" #Install Chocolatey Set-ExecutionPolicy Bypass -Scope Process -Force Invoke-Expression((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) #Install 7zip choco install 7zip #Close the session. Exit-PSSession |
Yes, is so clean and easy to read and if you don’t need an interactive session you can even use a simple invoke-command, but it’s a less readable oneliner.
1 2 3 4 5 |
#Remember to run PowerShell as an administrator Invoke-Command -ComputerName "WORKSTATION1" -ScriptBlock {Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); choco install 7zip} |