Here's the code I have been using... (and it's been working great!)
function DoUnpin([string]$appname) {
$ErrorActionPreference = 'silentlycontinue'
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() `
| Where-Object { $_.Name -eq $appname }).Verbs() `
| Where-Object { $_.Name.replace('&', '') -match 'Unpin from taskbar' } `
| ForEach-Object { $_.DoIt(); }
$ErrorActionPreference = 'continue'
}
DoUnpin "Microsoft Store"
DoUnpin "Mail"
DoUnpin "Store"
DoUnpin "Edge"
DoUnpin "Microsoft Edge"
But in the last couple weeks Microsoft has been rolling out the new Chromium-based Edge (the one with the swirly icon) and I have not been able to figure out how to unpin it without using the mouse/GUI.
Anyone have any inisght on as to why this might be?