From 5623edae66a2c6057664c5eedd0f60cb84215ed3 Mon Sep 17 00:00:00 2001 From: djust270 Date: Wed, 12 Oct 2022 14:58:52 -0400 Subject: [PATCH 1/4] Added Get-AppAUMID function --- ...ation-user-model-id-of-an-installed-app.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md index 27d56ce3c5..8b57c08b2f 100644 --- a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md +++ b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md @@ -109,3 +109,40 @@ listAumids("CustomerAccount") # Get a list of AUMIDs for all accounts on the device: listAumids("allusers") ``` + +## Example +The following code sample creates a function in Windows PowerShell that returns the AUMID of any application currently listed in the Start Menu + +```powershell +function Get-AppAUMID { +param ( +[string]$AppName +) +$Apps = (New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() +if ($AppName){ + $Result = $Apps | Where-Object { $_.name -like "*$AppName*" } | Select-Object name,@{n="AUMID";e={$_.path}} + if ($Result){ + Return $Result + } + else {"Unable to locate {0}" -f $AppName} +} +else { + $Result = $Apps | Select-Object name,@{n="AUMID";e={$_.path}} + Return $Result +} +} +``` + +The following Windows PowerShell commands demonstrate how you can call the Get-AppAUMID function after you've created it. + +```powershell +# Get the AUMID for OneDrive +Get-AppAUMID -AppName OneDrive + +# Get the AUMID for Microsoft Word +Get-AppAUMID -AppName Word + +# List all apps and their AUMID in the Start Menu +Get-AppAUMID +``` + From 6934aed167e5e7aff7a11103d354ba4a9029a78c Mon Sep 17 00:00:00 2001 From: djust270 Date: Wed, 12 Oct 2022 14:59:15 -0400 Subject: [PATCH 2/4] Updated Get-AppAUMID --- .../find-the-application-user-model-id-of-an-installed-app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md index 8b57c08b2f..0e134f6c34 100644 --- a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md +++ b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md @@ -118,7 +118,7 @@ function Get-AppAUMID { param ( [string]$AppName ) -$Apps = (New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() +$Apps = (New-Object -ComObject Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() if ($AppName){ $Result = $Apps | Where-Object { $_.name -like "*$AppName*" } | Select-Object name,@{n="AUMID";e={$_.path}} if ($Result){ From b1a2f3c79d904537fb2c337903c7d764f03261c6 Mon Sep 17 00:00:00 2001 From: David Just <57944742+djust270@users.noreply.github.com> Date: Thu, 13 Oct 2022 05:15:41 -0400 Subject: [PATCH 3/4] Update windows/configuration/find-the-application-user-model-id-of-an-installed-app.md Co-authored-by: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com> --- .../find-the-application-user-model-id-of-an-installed-app.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md index 0e134f6c34..4960887e14 100644 --- a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md +++ b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md @@ -111,7 +111,8 @@ listAumids("allusers") ``` ## Example -The following code sample creates a function in Windows PowerShell that returns the AUMID of any application currently listed in the Start Menu + +The following code sample creates a function in Windows PowerShell that returns the AUMID of any application currently listed in the Start menu. ```powershell function Get-AppAUMID { From 3635446ec3c7e6e34083ba6b64004104096a2b55 Mon Sep 17 00:00:00 2001 From: David Just <57944742+djust270@users.noreply.github.com> Date: Thu, 13 Oct 2022 05:15:53 -0400 Subject: [PATCH 4/4] Update windows/configuration/find-the-application-user-model-id-of-an-installed-app.md Co-authored-by: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com> --- .../find-the-application-user-model-id-of-an-installed-app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md index 4960887e14..4e3e609d5e 100644 --- a/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md +++ b/windows/configuration/find-the-application-user-model-id-of-an-installed-app.md @@ -143,7 +143,7 @@ Get-AppAUMID -AppName OneDrive # Get the AUMID for Microsoft Word Get-AppAUMID -AppName Word -# List all apps and their AUMID in the Start Menu +# List all apps and their AUMID in the Start menu Get-AppAUMID ```