Skip to content

Instantly share code, notes, and snippets.

@PatrickLang
Created January 7, 2019 20:04
Show Gist options
  • Save PatrickLang/17507ed96fae89c8db4f5620389036d4 to your computer and use it in GitHub Desktop.
Save PatrickLang/17507ed96fae89c8db4f5620389036d4 to your computer and use it in GitHub Desktop.
Expand & organize a bunch of stuff downloaded from BandCamp
gci *.zip | %{ Expand-Archive $_ }
gci -Directory | %{
$parts = $_.Name.Split("-")
$artist = $parts[0].TrimEnd().TrimStart()
$album = (-join $parts[1..($parts.Length-1)]).TrimEnd().TrimStart()
$newdirname = [System.IO.Path]::Combine($artist,$album)
$newdir = mkdir $newdirname
Move-item $_\* $newdir
Remove-Item $_
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment