Ironman Software Forums
Continue the conversion on the Ironman Software forums. Chat with over 1000 users about PowerShell, PowerShell Universal, and PowerShell Pro Tools.
In this post, we’ll modify the Windows 11 Start Menu items in PowerShell.
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
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 *
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'
}
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'
}
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'
}
You can also add drives by path.
$Layout.pinnedList += @{
desktopAppId = 'D:\'
}
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
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
.
Find this useful? Please consider sharing this article. Have a question about PowerShell? Contact us and we'll write a post about it.
Continue the conversion on the Ironman Software forums. Chat with over 1000 users about PowerShell, PowerShell Universal, and PowerShell Pro Tools.
Receive once-a-month updates about Ironman Software. You'll learn about our product updates and blogs related to PowerShell.