Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # based on: http://techibee.com/powershell/pin-applications-to-task-bar-using-powershell/685
- function toggle-pin
- {
- param([parameter(Mandatory = $true)]
- [string]$application)
- $al = $application.Length
- $appfolderpath = $application.SubString(0, $al - ($application.Split(“\”)[$application.Split("\").Count - 1].Length))
- $objshell = New-Object -ComObject “Shell.Application”
- $objfolder = $objshell.Namespace($appfolderpath)
- $appname = $objfolder.ParseName($application.SubString($al - ($application.Split(“\”)[$application.Split("\").Count - 1].Length)))
- $verbs = $appname.verbs()
- foreach ($verb in $verbs)
- {
- if ($verb.name -match “(&K)”)
- {
- $verb.DoIt()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement