Intune allows to automatically have software installed on target devices. I found a nice write-up on using this in conjunction with Chocolatey, but realized it could be made much easier. First we’ll prepare the files locally which needs to be done only once, instead of for each application.
The following steps depend on Chocolatey, so first follow the previously mentioned write-up on how to install that through Intune.
Save the script below as
install.ps1 in an empty directory, and download
IntuneWinAppUtil.exe into that directory as well.
upgradewill install the package if it isn’t yet installed. Two fish.
You can use this script directly by running
./install.ps1 <package name> [-uninstall]. We’ll use Intune to automate installation of packages.
Now let’s create a generic
.intunewin file for all our chocolatey apps. In the directory run the following in Powershell:
This creates an
.intunewin file which we can re-use in Intune for each application we wish to install using Chocolatey.
When creating an Intune app, set it as a
Windown app (Win32) and during the wizard set the install command to
And the uninstall command to
And make sure to set Chocolatey as a dependency.