Skip to content

Instantly share code, notes, and snippets.

@janjaali
Last active July 31, 2019 20:52
Show Gist options
  • Save janjaali/3ddec1dd05ae30f47a4df627ae379f25 to your computer and use it in GitHub Desktop.
Save janjaali/3ddec1dd05ae30f47a4df627ae379f25 to your computer and use it in GitHub Desktop.
Some little helpers
# Creates zip-archives for each directory in the current path
Get-ChildItem . | ForEach-Object {
if ($_.PSIsContainer) {
$dirName = $_.Name
$zipName = "$dirName`.zip"
echo "Compress $dirName"
Compress-Archive -Path $dirName\* -DestinationPath $zipName
}
}
# Removes all local branches expect for the current one
git branch -d $(git branch --format '%(refname:short)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment