Skip to content

Instantly share code, notes, and snippets.

@ShadowCreator250
Last active November 4, 2023 16:57
Show Gist options
  • Save ShadowCreator250/8cedc9cd46e1c6d8171eaf9c2a2ea7ad to your computer and use it in GitHub Desktop.
Save ShadowCreator250/8cedc9cd46e1c6d8171eaf9c2a2ea7ad to your computer and use it in GitHub Desktop.
generate scoop cleanup command from scoop status

generate scoop cleanup command from scoop status

So you can automatically cleanup all packages after scoop update *.

Ignores held packages.

Dependency:

scoop install busybox

workflow

scoop update > $null
# call script, eg:
gen-scoop-cleanup-cmd.ps1
scoop update *
# paste(, edit) & run
echo "scoop cleanup $(scoop status -l | grep -v "Held package" | grep -o -e "^[^[:space:]]*" | tail -n +3 | paste -sd ' ')" | clip
@ShadowCreator250
Copy link
Author

TODO:

  • convert into native Powershell script, remove dependency
  • make a scoop manifest, so this tool can be installed via scoop
  • (optional): prepend with scoop status -l output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment