Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. function Pin-App { param(
  2. [string]$appname,
  3. [switch]$unpin
  4. )
  5. try{
  6. if ($unpin.IsPresent){
  7. ((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()}
  8. return "App '$appname' unpinned from Start"
  9. }else{
  10. ((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()}
  11. return "App '$appname' pinned to Start"
  12. }
  13. }catch{
  14. Write-Error "Error Pinning/Unpinning App! (App-Name correct?)"
  15. }
  16. }
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. Pin-App "Mail" -unpin
  24. Pin-App "Store" -unpin
  25. Pin-App "Calendar" -unpin
  26. Pin-App "Microsoft Edge" -unpin
  27. Pin-App "Photos" -unpin
  28. Pin-App "Cortana" -unpin
  29. Pin-App "Weather" -unpin
  30. Pin-App "Phone Companion" -unpin
  31. Pin-App "Twitter" -unpin
  32. Pin-App "Skype Video" -unpin
  33. Pin-App "Candy Crush Soda Saga" -unpin
  34. Pin-App "xbox" -unpin
  35. Pin-App "Groove music" -unpin
  36. Pin-App "movies & tv" -unpin
  37. Pin-App "microsoft solitaire collection" -unpin
  38. Pin-App "money" -unpin
  39. Pin-App "get office" -unpin
  40. Pin-App "onenote" -unpin
  41. Pin-App "news" -unpin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement