Unpin the Microsoft Edge and store taskbar shortcuts programmatically

Question:

I setup computers daily and I need to remove the Microsoft Edge and Store taskbar shortcuts.

I am having trouble creating a script and I have searched for other stackoverflow posts but they were not helpful to me.

Does anyone have a script that can unpin the MS Edge and Store taskbar shortcuts?

Answer:

You can unpin taskbar items by running the following PowerShell commands.

This should work for any application on the taskbar. If the application isn’t found, the error InvokeMethodOnNull will be thrown.

What this does:

  • Enumerates the Shell/taskbar COM object namespace
  • Matches the item with the name $appname (in this case, Edge and Store)
  • Gets the verb Unpin from taskbar of that com object
  • Executes the verb to remove it from the taskbar (without having to kill explorer.exe)

Source:

Unpin the Microsoft Edge and store taskbar shortcuts programmatically by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply