Skip to content

Instantly share code, notes, and snippets.

@mikecasas
Created January 4, 2016 02:46
Show Gist options
  • Save mikecasas/5d58198fc9a2c46c4cf0 to your computer and use it in GitHub Desktop.
Save mikecasas/5d58198fc9a2c46c4cf0 to your computer and use it in GitHub Desktop.
cls
$mainFolder=("C:\pbc-2015")
$finalFolder=($mainFolder + "\pm\")
$lines=Get-ChildItem $mainFolder |
Where-Object {$_.name -like "*pm*" -and $_.name -like "*mp3*"} |
select name
foreach ($line in $lines) {
$i=($mainFolder + "\" + $line.Name);
Write-Output $i
Move-Item $i $finalFolder
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment