Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. Pin-App "Mail" -unpin
  19. Pin-App "Store" -unpin
  20. Pin-App "Calendar" -unpin
  21. Pin-App "Microsoft Edge" -unpin
  22. Pin-App "Photos" -unpin
  23. Pin-App "Cortana" -unpin
  24. Pin-App "Weather" -unpin
  25. Pin-App "Phone Companion" -unpin
  26. Pin-App "Twitter" -unpin
  27. Pin-App "Skype Video" -unpin
  28. Pin-App "Candy Crush Soda Saga" -unpin
  29. Pin-App "xbox" -unpin
  30. Pin-App "Groove music" -unpin
  31. Pin-App "movies & tv" -unpin
  32. Pin-App "microsoft solitaire collection" -unpin
  33. Pin-App "money" -unpin
  34. Pin-App "get office" -unpin
  35. Pin-App "onenote" -unpin
  36. Pin-App "news" -unpin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement