Remove Edge from Taskbar using PowerShell


  • I am using a PowerShell script to add and remove icons to taskbar - users can run it. Basically it uses the PS verbs to pin or unpin. Works fine but I can't get rid of Edge.

    $shell = New-Object -ComObject Shell.Application 

    #Unpin Microsoft Edge
    $folder = $shell.NameSpace((Join-Path ${env:Windir} 'SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe'))
    $item = $folder.parsename('MicrosoftEdge.exe')
    $verb = $item.Verbs() | ? {$_.Name -eq 'Unpin from tas&kbar'}
    if ($verb) {$verb.DoIt()}

    Looking at articles it states the file location of Microsoftedge.exe to be as above but if you run the script above manually there is no verb to unpin so I'm pretty sure the icon is NOT from that exe. Moreover that icon has a white background. By hand you can do an unpin from Taskbar so where is this icon located ???. I realise the icons are created with the profile, but that's the whole point of running it as the user so they can pin/unpin as needed via the script

    Ian Burnell, London (UK)

    Friday, July 15, 2016 8:32 AM


All replies