A few days ago I’ve stumbled across a situation where an MSIX application was decided to be removed from all users in the infrastructure. However, there were many versions of the applications and some users even had multiple architectures installed on the machine. To make things much easier and in order to reduce the number of apps required in Intune, I decided that we go with a simple PowerShell script to achieve this.
For the script, we are going to use two PowerShell cmdlets targeted for MSIX/APPX applications: Get-AppPackage and Remove-AppPackage. Yes i know the links are saying Get-AppxPackage and Remove-AppxPackage, but you can use the previous aliases that I’ve mentioned, the results are the same.
So basically what we need is to parse all MSIX apps from the user and uninstall the ones we need. To do this, the script is as follows:
$test = Get-AppxPackage -name "*test*" foreach ($app in $test){ write-host $app.PackageFullname Remove-AppPackage -Package $app.PackageFullname }