Skip to content

Instantly share code, notes, and snippets.

@takumaw
Created September 29, 2023 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takumaw/8af6a832d8cce82201a74b3fa14a929d to your computer and use it in GitHub Desktop.
Save takumaw/8af6a832d8cce82201a74b3fa14a929d to your computer and use it in GitHub Desktop.
function unpin_taskbar([string]$appname) {
((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | Where-Object {$_.Name -eq $appname}).Verbs() | Where-Object {$_.Name.replace('&','') -match 'タスク バーからピン留めを外す'} | ForEach-Object {$_.DoIt()}
}
foreach ($taskbarapp in ("PowerPoint", "Excel")) {
Write-Host "Unpinning $taskbarapp"
unpin_taskbar("$taskbarapp")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment