This script lists the Windows Apps (Universal applications) installed on the system. It works but the command Get-AppxPackageManifest $app produces an error when the manifest file is not found. In my case, it happens for the app Windows.MiracastView.
I'm not familiar enough with PS scripting to write code to trap and avoid this error. What would be the "IF" command to skip an $app if its manifest file is not found?
$installedapps = get-AppxPackage
foreach ($app in $installedapps)
{
echo $app.Name
foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
{
$line = $app.Name + "=" + $app.packagefamilyname + "!" + $id
echo $line
$line >> 'C:\Temp\CollectWindowsAppsList.txt'
}
}
echo "Press any key to continue..."
[void][System.Console]::ReadKey($true)
Thanks.