Windows 10: Windows 10 1909 - Why are Pin To Start/Taskbar verbs through PowerShell broken?

Discus and support Windows 10 1909 - Why are Pin To Start/Taskbar verbs through PowerShell broken? in Windows 10 Customization to solve the problem; In previous versions of Windows 10, I was able to use PowerShell to pin applications to the Start Menu and Taskbar, which was a HUGE help. In Windows... Discussion in 'Windows 10 Customization' started by Montinator, Jan 28, 2020.

  1. Windows 10 1909 - Why are Pin To Start/Taskbar verbs through PowerShell broken?


    In previous versions of Windows 10, I was able to use PowerShell to pin applications to the Start Menu and Taskbar, which was a HUGE help.


    In Windows 10 1909, Microsoft appears to have blocked this feature, and I have not seen any way around this, scouring the internet for hours on end.


    Here is a PowerShell one-liner to pin the applications to the Start Menu:

    New-Object -Com Shell.Application.NameSpace'shell:::{4234d49b-0245-4df3-b780-3893943456e1}'.Items ?{$_.Name -eq "Windows PowerShell"}.Verbs ?{$_.Name.replace'&','' -match 'Pin to Start'} %{$_.DoIt}



    It works in previous OS builds, but in 1909 I get this error:

    Access is denied. Exception from HRESULT: 0x80070005 E_ACCESSDENIED

    At line:1 char:208

    + ... s ?{$_.Name.replace'&','' -match 'Pin to Start'} %{$_.DoIt}

    + ~~~~~~~~~

    + CategoryInfo : OperationStopped: : [], UnauthorizedAccessException

    + FullyQualifiedErrorId : System.UnauthorizedAccessException


    This one-liner shows the available verbs to use, and '&Pin to Start' is listed basically options available when you right-click a shortcut:

    New-Object -Com Shell.Application.NameSpace'shell:::{4234d49b-0245-4df3-b780-3893943456e1}'.Items ?{$_.Name -eq "Windows PowerShell"}.Verbs


    Output:

    Application Parent Name

    ----------- ------ ----

    Open

    Open file location

    Open new window

    Run as administrator

    Run as different user

    Uninstall

    &Pin to Start

    Create &shortcut


    It works if you replace the 'Pin to Start' with any available verbs like Open, Properties, Run as administrator, etc. on 1909, but they broke the pin verb. The only documentation from Microsoft that I was able to find is to use Export-StartLayout and Import-StartLayout, but this only affects the Default User, for new users. I need to be able to automatically pin applications to existing users in a deployment script.

    :)
     
    Montinator, Jan 28, 2020
    #1
  2. ddacnayr Win User

    Windows PowerShell - Pin and Unpin Programmatically

    Hey MS Community,

    I'm looking for a method to programmatically unpin Microsoft Edge and pin Internet Explorer. Currently, our vendors have sites that are only supported in Internet Explorer, and will result in an error if opened with Microsoft Edge. Since the two icons are
    so similar, many new users end up calling IT simply due to using the wrong browser. This is because Edge is pinned by default whenever a user first signs in.

    I was able to find a program online that unpin's programs, however I can't seem to get the pin portion functioning.

    Thanks in advance for taking a look.

    Here is the script that I have:

    Code:
    function Pin-App ([string]$appname, [switch]$unpin, [switch]$start, [switch]$taskbar, [string]$path) {    if ($unpin.IsPresent) {        $action = "Unpin"    } else {        $action = "Pin"    }    if (-not $taskbar.IsPresent -and -not $start.IsPresent) {        Write-Error "Specify -taskbar and/or -start!"    }    if ($taskbar.IsPresent) {        try {            $exec = $false            if ($action -eq "Unpin") {                ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from taskbar'} | %{$_.DoIt();
     $exec = $true}                if ($exec) {                    Write "App '$appname' unpinned from Taskbar"                } else {                    if (-not $path -eq "") {                        Pin-App-by-Path $path -Action $action                    } else {                        Write "'$appname' not found or 'Unpin from taskbar' not found on item!"                    }                }            } else {                ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Pin to taskbar'} | %{$_.DoIt(); $exec
     = $true}                if ($exec) {                    Write "App '$appname' pinned to Taskbar"                } else {                    if (-not $path -eq "") {                        Pin-App-by-Path $path -Action $action                    } else {                        Write "'$appname' not found or 'Pin to taskbar' not found on item!"                    }                }            }        } catch {            Write-Error "Error Pinning/Unpinning $appname to/from taskbar!"        }    }    if ($start.IsPresent) {        try {            $exec = $false            if ($action -eq "Unpin") {                ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from Start'} | %{$_.DoIt(); $exec
     = $true}                if ($exec) {                    Write "App '$appname' unpinned from Start"                } else {                    if (-not $path -eq "") {                        Pin-App-by-Path $path -Action $action -start                    } else {                        Write "'$appname' not found or 'Unpin from Start' not found on item!"                    }                }            } else {                ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Pin to Start'} | %{$_.DoIt(); $exec
     = $true}                if ($exec) {                    Write "App '$appname' pinned to Start"                } else {                    if (-not $path -eq "") {                        Pin-App-by-Path $path -Action $action -start                    } else {                        Write "'$appname' not found or 'Pin to Start' not found on item!"                    }                }            }        } catch {            Write-Error "Error Pinning/Unpinning $appname to/from Start!"        }    }}function Pin-App-by-Path([string]$Path, [string]$Action, [switch]$start) {    if ($Path -eq "") {        Write-Error -Message "You need to specify a Path" -ErrorAction Stop    }    if ($Action -eq "") {        Write-Error -Message "You need to specify an action: Pin or Unpin" -ErrorAction Stop    }    if ((Get-Item -Path $Path -ErrorAction SilentlyContinue) -eq $null){        Write-Error -Message "$Path not found" -ErrorAction Stop    }    $Shell = New-Object -ComObject "Shell.Application"    $ItemParent = Split-Path -Path $Path -Parent    $ItemLeaf = Split-Path -Path $Path -Leaf    $Folder = $Shell.NameSpace($ItemParent)    $ItemObject = $Folder.ParseName($ItemLeaf)    $Verbs = $ItemObject.Verbs()    if ($start.IsPresent) {        switch($Action){            "Pin"   {$Verb = $Verbs | Where-Object -Property Name -EQ "&Pin to Start"}            "Unpin" {$Verb = $Verbs | Where-Object -Property Name -EQ "Un&pin from Start"}            default {Write-Error -Message "Invalid action, should be Pin or Unpin" -ErrorAction Stop}        }    } else {        switch($Action){            "Pin"   {$Verb = $Verbs | Where-Object -Property Name -EQ "Pin to Tas&kbar"}            "Unpin" {$Verb = $Verbs | Where-Object -Property Name -EQ "Unpin from Tas&kbar"}            default {Write-Error -Message "Invalid action, should be Pin or Unpin" -ErrorAction Stop}        }    }    if($Verb -eq $null){        Write-Error -Message "That action is not currently available on this Path" -ErrorAction Stop    } else {        $Result = $Verb.DoIt()    }}Pin-App "Microsoft Edge" -unpin -taskbarPin-App-by-Path "C:\Program Files\internet explorer\iexplore.exe" -pin -taskbar
     
    ddacnayr, Jan 28, 2020
    #2
  3. Pin to taskbar - Windows 10 Ent. x64 (Ver. 1511 - OS Build 10586)

    Hi,

    If you're using the "InvokeVerb" method to Pin items to Taskbar, note that it no longer works in Windows 10. The "Pin to taskbar" verb doesn't even list when the context menu entries are enumerated using script.

    There is a workaround, using a third-party tool. Check out:

    Pin Programs to the Taskbar in Windows 10 with Group Policy
     
    Ramesh Srinivasan, Jan 28, 2020
    #3
  4. MDJ
    MDJ Win User

    Windows 10 1909 - Why are Pin To Start/Taskbar verbs through PowerShell broken?

    Windows 10 problem with duplicated icons in taskbar, broken Jump Lists


    Hello,


    I‘ve been recently having a problem with duplicated items in taskbar and broken Jump Lists. I‘m now using Windows 10 but this problem occurred in Windows 8.1 too but then it somehow fixed itself. Some programs that I pin to taskbar have a tendency to duplicate themselves when clicked on. For now, I‘ve noticed this behaviour only in Skype and Spotify but it‘s still very annoying since duplicate icons take valuable taskbar space and even more—make Jump Lists of those programs broken, meaning that you can still see tasks program developers provided but after you click them nothing happens.


    I‘ve tried loads of times pinning, repinning, deleting whole User Pinned folder from %appdata%/Microsoft/Internet Explorer/Quick Launch, clearing Jump List folders manually and automatically with Command Prompt commands as suggested here with no luck. The only thing I did achieve was when I pinned Skype to taskbar in my other user account, then copied the newly created shortcut from Use Pinned folder to my User Pinned folder—this made Skype Jump Lists working but duplicate icon in taskbar remained.


    I‘ve recently found a tutorial which may force taskbar to use only one icon per app but I can‘t check this right now as 7+ Taskbar Tweaker isn‘t yet officially available for Windows 10 users.


    Thank you for taking your time and reading my message, any suggestions would be appreciated,





    P. S. I don‘t know if this is related but I can‘t pin any Control Panel item to Quick Access whilst I can pin folders. Interesting side of this is that pinned Control Panel items appear in File Explorer's Jump List but after clicked I get a message that item is unavailable and that it might have been moved, renamed or removed.
     
Thema:

Windows 10 1909 - Why are Pin To Start/Taskbar verbs through PowerShell broken?

Loading...
  1. Windows 10 1909 - Why are Pin To Start/Taskbar verbs through PowerShell broken? - Similar Threads - 1909 Why are

  2. Updating Windows 10 through Powershell

    in Windows 10 Installation and Upgrade
    Updating Windows 10 through Powershell: I was just wondering if Windows 10 can be directy updated through Powershell without navigating through Settings> Update and Security. Is there a particular command that I can directly type and enter in powershell to update windows?...
  3. Windows Security through PowerShell

    in AntiVirus, Firewalls and System Security
    Windows Security through PowerShell: Is there a way to take action towards threats in Windows Security automatically through a PowerShell applet or cmd command? For example, I see that there was a threat detected, I could run a script on my desktop that quickly tells Windows Security to remove or allow the...
  4. Windows 10 1909 MUI broken search bar and start menu

    in Cortana
    Windows 10 1909 MUI broken search bar and start menu: Hi folks, I installed Windows 10 1909 from scratch in english. After that I installed via dism.exe german language pack call dism.exe /norestart /online /add-package /packagepath:"c:\temp\Microsoft-Windows-Client-Language-Pack_x64_de-de.cab" and set the default display...
  5. Cannot install app through Store or as an .appx through PowerShell on Win10 1909; error...

    in Windows 10 Ask Insider
    Cannot install app through Store or as an .appx through PowerShell on Win10 1909; error...: The specific app I really want to use is Kano's The Force Coding Kit if that matters, however the issue occurs with other stock system apps that I try to update, as well as "App Installer," which I had attempted to install as an alternative to PowerShell once I retrieved the...
  6. Why is 1909 so broken for me?

    in Windows 10 Ask Insider
    Why is 1909 so broken for me?: OS Build: 18363.476 I've been having issues about audio recently, fixed that, now after updating to the "latest" build of 1909, Windows Defender breaks, then my web browsers break, then Malwarebytes breaks! What's going on, Microsoft? EDIT: Restarting fixes it, then after a...
  7. Windows 10 1909 sync settings broken?

    in Windows 10 Customization
    Windows 10 1909 sync settings broken?: Hello Community, i updated 3 devices with Windows 10 1909 iso from my visiual studio subscription and started to wonder since my edge favorites didnt sync anymore. Also tested different other Windows sync settings like design and settings an none of them happend to sync via...
  8. PowerShell "Get-Command -Verb Get" format different from documentation

    in Windows 10 Network and Sharing
    PowerShell "Get-Command -Verb Get" format different from documentation: According to the documentation for PowerShell 6, the PowerShell command "Get-Command -Verb Get" should output a format similar to: CommandType Name Definition ----------- ---- ---------- Cmdlet Get-Acl...
  9. PowerShell Bitlocker command uses unaproved verbs and verbosity setting

    in Windows 10 Customization
    PowerShell Bitlocker command uses unaproved verbs and verbosity setting: If I have this statement at the start of a script: #requires -Version 3.0 -Modules BitLocker, Hyper-V, Storage I see this message when I run the script: WARNING: The names of some imported commands from the module 'BitLocker' include unapproved verbs that might make...
  10. Pin Excel to start and or taskbar

    in Microsoft Office and 365
    Pin Excel to start and or taskbar: Cannot Pin Excel to start menu or task bar. Office shows on start menu but have to open it first then Excel. Excel does not show on list of programs. It opens fine when I go to office THEN to excel but would be more convenient to go directly to Excel since I use it often 100276

Users found this page by searching for:

  1. 1909 start menu powershell

    ,
  2. windows 10 1909 startmenu unpin script

    ,
  3. windows 1909 taskbar for all users

    ,
  4. powershell customize taskbar windows 10 1909,
  5. windows 10 1909 powershell command to pin application to start,
  6. unpin taskbar for all users windows 10 1909,
  7. pin skype to