Given AppUserModelID (AUMID) Is there a way to get the application name from this data (without attempting to do some string manipulation on the AppUserModelID)?
I am
If you want to find a Store/UWP application in the shell:AppsFolder
by it's AUMID filter by the Path
attribute instead of by the name. For Store apps the Path
attribute contains the app's AUMID.
Note that for desktop apps the Path
attribute gives an actual path to the executable.
Instead of trying to find the application name from the AUMID simply add them by their AUMID.
Jeez:
function Pin-App { param(
[string]$aumid,
[switch]$unpin
)
try{
if ($unpin.IsPresent){
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Path -eq $aumid}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from Start'} | %{$_.DoIt()}
return "App '$aumid' unpinned from Start"
}else{
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Path -eq $aumid}).Verbs() | ?{$_.Name.replace('&','') -match 'Pin to Start'} | %{$_.DoIt()}
return "App '$aumid' pinned to Start"
}
}catch{
Write-Error "Error Pinning/Unpinning App! (App-Name correct?)"
}
}