Published in Articles on by Michiel van Oosterhout ~ 5 min read
After removing built-in apps from Windows 11 the Start menu still has some pinned apps that you may want to remove. When you select some of these apps they get installed 'on-demand' and then they are launched. Some or all of these pinned apps, like WhatsApp, TikTok, and Instagram may be unnecessary or undesired. But these pinned apps are not actually installed, so automating the removal of these pinned apps is not possible. What we can do is provide a guided removal using PowerShell.

The StartLayout PowerShell module
The StartLayout PowerShell module provides a cmdlet to export the current layout of the Start menu. Customization of the Start menu in Windows 11 is explained here, and the Start/ConfigureStartPins configuration service provider (CSP) policy is mentioned as the way to "push a new list of pinned apps to override the default/current list of pinned apps in the Windows 11 Start menu."
Deploying a CSP policy requires an MDM provider (like Microsoft Endpoint Manager). Without that the layout of the Start menu has to be adjusted manually. We will use the Export-StartLayout
cmdlet to monitor the current layout until it satisfies our requirements.
Providing guidance for the removal of apps pinned to the Start menu
The Windows PowerShell script below will monitor the Start menu layout until all pinned apps in the $appsToUninstall
variable have been removed. (You can adjust the list as needed, this is just a suggested list.)
# This is a set of apps pinned to the Start menu that should be uninstalled
$appsToUninstall = @(
@{ Id = "5319275A.WhatsAppDesktop_cv1g1gvanyjgm!App"; DisplayName = "WhatsApp" }
@{ Id = "AmazonVideo.PrimeVideo_pwbj9vvecjh7j!App"; DisplayName = "Prime Video" }
@{ Id = "BytedancePte.Ltd.TikTok_6yccndn6064se!App"; DisplayName = "TikTok" }
@{ Id = "Disney.37853FC22B2CE_6rarf9sa4v8jt!App"; DisplayName = "Disney+" }
@{ Id = "Facebook.317180B0BB486_8xx8rvfyw5nnt!App"; DisplayName = "Messenger" }
@{ Id = "Facebook.InstagramBeta_8xx8rvfyw5nnt!App"; DisplayName = "Instagram" }
@{ Id = "Microsoft.GamingApp_8wekyb3d8bbwe!Microsoft.Xbox.App"; DisplayName = "Xbox" }
@{ Id = "Microsoft.Todos_8wekyb3d8bbwe!App"; DisplayName = "To Do" }
@{ Id = "Microsoft.Windows.Photos_8wekyb3d8bbwe!App"; DisplayName = "Microsoft Photos" }
@{ Id = "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"; DisplayName = "Windows Calculator" }
@{ Id = "Microsoft.WindowsCommunicationsApps_8wekyb3d8bbwe!Microsoft.WindowsLive.Mail"; DisplayName = "Mail and Calendar" }
@{ Id = "Microsoft.ZuneVideo_8wekyb3d8bbwe!Microsoft.ZuneVideo"; DisplayName = "Movies & TV" }
@{ Id = "SpotifyAB.SpotifyMusic_zpdnekdrzrea0!Spotify"; DisplayName = "Spotify" }
)
# This will be used to display the next pinned app that should be uninstalled
$waitingFor = [string]::Empty
# The path to a temporary file that contains the Start menu layout
$path = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath "StartLayout.json"
Clear-Host
while ($true)
{
Export-StartLayout –Path $path
# These are all the apps currently pinned to the Start menu
$pinnedApps = Get-Content -Path $path | ConvertFrom-Json | Select-Object -ExpandProperty pinnedList
# For each pinned app that should be uninstalled, wait for it to be uninstalled
$pinnedApps | ForEach-Object {
# Determine the identifier of the pinned app
$id = $_.desktopAppLink
if ($id -eq $null)
{
$id = $_.desktopAppId
}
if ($id -eq $null)
{
$id = $_.packagedAppId
}
# Determine if the pinned app should be uninstalled
$matches = $appsToUninstall.Where({ $_.Id -ieq $id })
# If the pinned app should be uninstalled
if ($matches.Count -gt 0)
{
$displayName = $matches[0].displayName
# If the script was already waiting for this pinned app to be uninstalled...
if ($waitingFor -eq $id)
{
# ...write a dot to indicate the script is waiting
Write-Host "." -NoNewline
}
else
{
# If the script starts waiting for the next pinned app to be uninstalled...
if ($waitingFor -ne "")
{
# ...confirm the removal of the previous pinned app
Write-Host " OK"
}
# Keep track of the pinned app the script is waiting for
$waitingFor = $id
Write-Host "Waiting for [$displayName] to be uninstalled..." -NoNewline
}
# Wait another second for the pinned app to be uninstalled
Start-Sleep -Seconds 1
continue
}
}
break
}
An app pinned to the Start menu can be a desktop app or a packaged app with an ID. Some packaged apps have cryptic names, for example Facebook.317180B0BB486
for Messenger. The script defines a display name for each pinned app that matches the name in the Start menu, and uses that for its output.


For packaged apps the script uses the name of the specific application inside the package, for example Microsoft.GamingApp_8wekyb3d8bbwe!Microsoft.Xbox.App
. This name consists of the package's name (Microsoft.GamingApp
) and a hash of the package's publisher information (8wekyb3d8bbwe
, which is Microsoft Corporation's hash), separated by an underscore, followed by an exclamation mark (!
) and the specific application's name (Microsoft.Xbox.App
). This is because an AppX package can contain more than one app, and each app can be pinned to the Start menu separately. For example the Mail and Calendar apps:
Microsoft.WindowsCommunicationsApps_8wekyb3d8bbwe!Microsoft.WindowsLive.Mail
Microsoft.WindowsCommunicationsApps_8wekyb3d8bbwe!Microsoft.WindowsLive.Calendar
Summary
Although we cannot fully automate the removal of pinned apps from the Start menu in Windows 11, we can use the Export-StartLayout
cmdlet to check the layout for pinned apps that should be uninstalled. This can be used in a PowerShell script to provide a guided removal of pinned apps from the Start menu.