Modify the Windows 11 Start Menu Layout with PowerShell

Image Description

Daily PowerShell #50

Daily PowerShell Windows 11

December 4, 2021

quote Discuss this Article

In this post, we’ll modify the Windows 11 Start Menu items in PowerShell.

Exporting the Current Start Menu Layout

The start menu layout can be exported using the Export-StartLayout cmdlet from the StartLayout module. This module is builtin to Windows 11. The cmdlet exports a JSON string containing the current layout.

Export-StartLayout -Path .\LayoutModification.json

Modifying the Start Menu Layout

Once you have exported the current layout, you can read the JSON and edit it in PowerShell. The below script displays the current pinned items.

$Layout = Get-Content .\LayoutModification.json -Raw | ConvertFrom-Json
$Layout.pinnedList | fl *

Adding a Windows Store Application to the Start Menu

Windows Store applications using a packageID when being added to the Windows Start Menu. The below adds Windows Terminal to the Start Menu.

$Layout.pinnedList += @{ 
  packagedAppId = 'Microsoft.WindowsTerminal_8wekyb3d8bbwe!App'
} 

Adding an Application with an Application User Model ID (AUMID)

You can also add applications that did not come from the store but have registered an AUMID. The below adds Visual Studio Code to the Start Menu.

$Layout.pinnedList += @{ 
  desktopAppId = 'Microsoft.VisualStudioCode'
} 

Adding an Application by Path

You can also add unpackaged applications to the start menu using a path. The below adds PSScriptPad to the Start Menu.

$Layout.pinnedList += @{ 
  desktopAppId = 'C:\users\adamr\Desktop\PSScriptPad.x64.exe'
} 

Adding a Drive

You can also add drives by path.

$Layout.pinnedList += @{ 
  desktopAppId = 'D:\'
} 

Removing an Item From the Pinned List

The below converts the current array into an ArrayList and removes the item at position 13.

$List = [System.Collections.ArrayList]$Layout.pinnedList
$List.RemoveAt(13)
$Layout.pinnedList = $List

Import A Start Menu Layout

Unfortunately, at the time of this writing, it’s not possible to deploy the start menu with PowerShell. You will need to use Mobile Device Manager.

You can convert the $Layout object to JSON for use with MDM.

$Layout | ConvertTo-Json

Import-StartLayout only supports XML the XML format that is no longer generated by Export-StartLayout.