Automating App Deployment with Winget and Intune

There are some incredible community tools out there for app deployment via Winget and Intune, but as I’m sure you’ve noticed, I prefer a more hands-off script so decided to make my own.

I also stumbled across these PowerShell tools from a previous Microsoft Hackathon which opened up a world of possibilities!

As always, my script can be found on Github here or on PowerShell Gallery:

Install-Script -Name deploy-winget-win32-multiple

When launching the script you will be presented with a credentials box which will authenticate against both Azure AD and Microsoft Graph (you may get a second password prompt for AzureAD).

At this point it will also download the latest copy of the intunewin utility and install Winget if it’s not already installed (you’ll need this for the app list)

Once authenticated, the script will sit there for a minute while it grabs all of the apps available on Winget and then bring a GridView from PowerShell with a list of everything available:

As it uses the native GridView, you can do advanced filtering and select multiple apps via Ctrl or Shift select.

When you click ok, the magic happens!

The script churns away to create:

  • Directory in C:\Temp to store files
  • AzureAD Install and Uninstall Groups
  • Install and Uninstall PowerShell scripts
  • Custom Detection Script
  • Proactive Remediation (to update the app daily)
  • The intunewin file itself

Once created it will:

  • Upload the Intunewin file to Intune
  • Assign Install and Uninstall groups to it
  • Assign the Proactive Remediation to the install group

It’s all at the command line so fully silent, once you’ve selected your apps, leave it running, sit back and have a drink. All scripts use the exact app ID so no worries of it grabbing the wrong one either.

It’s all fully logged in the Windows Temp directory as well.

Remember to launch as an administrator or the Intunewinapputil will get very upset

Any comments, feedback or suggestions most welcome in the comments.

Posted in Intune