Created
January 7, 2019 20:04
-
-
Save PatrickLang/17507ed96fae89c8db4f5620389036d4 to your computer and use it in GitHub Desktop.
Expand & organize a bunch of stuff downloaded from BandCamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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