I am trying to pin a program to the start menu in Windows 10
$shell = New-Object -ComObject \"Shell.Application\"
$Folder = $shell.NameSpace(\"C:\\Test\")
$e
This is no longer possible in Windows 10 (latest seemed to work in 8.1). I can not say for sure, but these issues seem to be linked.
Please see here:
https://connect.microsoft.com/PowerShell/feedback/details/1609288/pin-to-taskbar-no-longer-working-in-windows-10
and also here:
Pin program to taskbar using PS in Windows 10.
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 'From "Start" UnPin|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 'To "Start" Pin|Pin to Start'} | %{$_.DoIt()}
return "App '$appname' pinned to Start"
}
}catch{
Write-Error "Error Pinning/Unpinning App! (App-Name correct?)"
}
}
Pin-App "Outlook 2016"
Pin-App "Google Chrome"
Pin-App "This PC"