If you are using a pre 2016 server, install the following patch

https://www.microsoft.com/en-us/download/details.aspx?id=51451

Here is the file in case the link above is no longer available


If you have ever used Linux you will be used to the idea of applications like yum, apt-get, or rpm.  For a long time Windows had nothing like this, so third parties filled this gap e.g. NuGet, and Chocolatey.

Since 2003 Windows did have a package management system but it wasn't very good.  Since version 5x (2016), it has become more comprehensive and a lot easier to work with.  The new architecture looks like this

Basically an end user can install packages (libraries and executable software) from various sources.

Listing available Package Management CommandLets

Using a PowerShell window run the following command

get-command -module packagemanagement | sort noun, verb

It will yield the following result

Listing Available Package Providers

find-packageprovider

Listing Installed Package Providers

get-packageprovider

Adding a Package Provider

// install the package provider
install-packageprovider <provider-name> -verbose

// add the package provider to the list of available providers on your machine
import-packageprovider <provider-name>

// check if package provider installed correctly
get-packageprovider -verbose


// install the package provider
install-packageprovider ChocolateyGet  -verbose

// add the package provider to the list of available providers on your machine
import-packageprovider ChocolateyGet

// you might have to install something from the package provider to allow its commands to be executed, for example chocolatey requires the choco.exe file to be available as a Windows application, use the command below to install chocolatey as a separate Windows application
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

// check if package provider installed correctly
get-packageprovider -verbose

Installing a Package

// check if a package provider is available on your local machine
get-packageprovider -verbose

install-package <package-name>
// OR
install-package -source <provider-name> -name <package-name>


// see what package providers are available on your machine
get-packageprovider -verbose

install-package mysql

// you might get a warning ssaying there are multiple source providers, rerun the command as follows
install-package -source chocolatey -name mysql 

Complete example of installing a Package Provider and a Package

// Check if the package provider exists
find-packageprovider ChocolateyGet  -verbose

// install the package provider
install-packageprovider ChocolateyGet  -verbose

// add the package provider to the list of available providers on your machine
import-packageprovider ChocolateyGet

// now install a package
get-packageprovider -verbose
// if the above might fail because choco.exe needs to be aavailable, use the command below to install chocolatey as a separate Windows application
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

install-package mysql

// you might get a warning ssaying there are multiple source providers, rerun the command as follows
install-package -source chocolatey -name mysql