Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created October 15, 2016 15:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save PrateekKumarSingh/b38030653b0974b47538f39142e53aef to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/b38030653b0974b47538f39142e53aef to your computer and use it in GitHub Desktop.
ForEach($item in ("C:\Users\Prateek\Downloads\music" |Get-MP3MetaData)){
$Source = $item.Fullname
$Album = $item.Album
Set-Location C:\Music
If(-not (gci | ?{$_.name -eq "$Album" -and $_.PSisContainer}))
{
New-Item -Name $Album -ItemType Directory -Force |Out-Null
}
$destination = "C:\Music\$album"
Move-Item -Path $Source -Destination $destination -Force -Verbose
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment