From fb1648a53c89b8cbc2b23e572f1f441119e443eb Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Fri, 7 Jan 2022 14:46:25 +0100 Subject: [PATCH] GetAUMIDs.ps1: Fix name resolution(?) --- GlosSIConfig/GetAUMIDs.ps1 | 45 +++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/GlosSIConfig/GetAUMIDs.ps1 b/GlosSIConfig/GetAUMIDs.ps1 index 2a06b8a..fc84dfa 100644 --- a/GlosSIConfig/GetAUMIDs.ps1 +++ b/GlosSIConfig/GetAUMIDs.ps1 @@ -3,38 +3,33 @@ $installedapps = get-AppxPackage $invalidNames = '*ms-resource*', '*DisplayName*' $aumidList = @() -foreach ($app in $installedapps) -{ +foreach ($app in $installedapps) { try { - if(-not $app.IsFramework){ - foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id) - { - $appx = Get-AppxPackageManifest $app; - $name = $appx.Package.Properties.DisplayName; + if (-not $app.IsFramework) { + foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id) { + $appx = Get-AppxPackageManifest $app; + $name = $appx.Package.Properties.DisplayName; - if($name -like '*DisplayName*' -or $name -like '*ms-resource*') - { - $name = $appx.Package.Applications.Application.VisualElements.DisplayName; - } - if($name -like '*DisplayName*' -or $name -like '*ms-resource*') - { - $name = "-Error-"; - } + if ($name -like '*DisplayName*' -or $name -like '*ms-resource*') { + $name = $appx.Package.Applications.Application.VisualElements.DisplayName; + } + if ($name -like '*DisplayName*' -or $name -like '*ms-resource*') { + $name = $app.Name; + } - $installDir = $app.InstallLocation; - $logo = $app.InstallLocation + "\" + $appx.Package.Applications.Application.VisualElements.Square150x150Logo; + $installDir = $app.InstallLocation; + $logo = $app.InstallLocation + "\" + $appx.Package.Applications.Application.VisualElements.Square150x150Logo; - $aumidList += $name + "|" + $installDir + "|" + $logo + "|" + - $app.packagefamilyname + "!" + $id + ";" - } + $aumidList += $name + "|" + $installDir + "|" + $logo + "|" + + $app.packagefamilyname + "!" + $id + ";" } } - catch - { - $ErrorMessage = $_.Exception.Message - $FailedItem = $_.Exception.ItemName - } + } + catch { + $ErrorMessage = $_.Exception.Message + $FailedItem = $_.Exception.ItemName + } } $aumidList;