Share via


Unpin apps with Powershell

Question

Thursday, August 23, 2018 1:38 PM

Hello,

is it possible to unpin pinned apps from the start menu via Powershell? I am only looking for a Powershell solution (not GPO oder whatever). The Windows version is Windows 10, version 1803.

All replies (2)

Thursday, August 23, 2018 2:01 PM ✅Answered

Hi,

Here's a script that works for me at least:

function Pin-App {    param(
        [string]$appname,
        [switch]$unpin
    )
    try{
        if ($unpin.IsPresent){
            ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Von "Start" lösen|Unpin from Start'} | %{$_.DoIt()}
            return "App '$appname' unpinned from Start"
        }else{
            ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'An "Start" anheften|Pin to Start'} | %{$_.DoIt()}
            return "App '$appname' pinned to Start"
        }
    }catch{
        Write-Error "Error Pinning/Unpinning App! (App-Name correct?)"
    }
}

Pin-App "Microsoft Store" -unpin

Basically add the line Pin-App "App name" -unpin to unpin apps, in my example I have the Microsoft Store.

Best regards,
Leon

Blog: https://thesystemcenterblog.com LinkedIn:


Sunday, August 26, 2018 9:02 AM

Hi,

Glad to hear that you have found a solution and thank you for sharing it here, it will be helpful to other community members who have same questions.

Regards,

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].