Skip to content

Instantly share code, notes, and snippets.

@diogotito
Last active February 1, 2024 13:56
Show Gist options
  • Save diogotito/597087133b089703e59e69c4a37872ed to your computer and use it in GitHub Desktop.
Save diogotito/597087133b089703e59e69c4a37872ed to your computer and use it in GitHub Desktop.
Search winget, Scoop and Chocolatey simultaneously in Windows Terminal with `pkg <search terms>` in PowerShell
# Search winget, Scoop and Chocolatey simultaneously in Windows Terminal
function pkg([string] $name) {
function Build-SearchCmd([string] $cmd) {
"C:\Windows\system32\cmd.exe", "/C", (@("ECHO ^> $cmd", "$cmd", "PAUSE") -join ' & ')
}
wt split-pane --vertical --size 0.5 (Build-SearchCmd "winget search $name") `; `
split-pane --horizontal --size 0.66 (Build-SearchCmd "scoop search $name") `; `
split-pane --horizontal --size 0.5 (Build-SearchCmd "choco search $name") `; `
focus-pane --target 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment