Created
May 24, 2022 18:47
-
-
Save kzndotsh/dc9e4f963588e49c890e3bd6f83f7f59 to your computer and use it in GitHub Desktop.
moveFilteredFilesToFolders.ps1
This file contains 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
$items = gci .\ -Recurse -File -Include *480p*, *720p*, *1080p* | |
foreach($item in $items) { | |
if($item.Name -like "*480p*") { | |
Move-Item -LiteralPath $item 'G:\path\480p' | |
} elseif($item.Name -like "*720p*") { | |
Move-Item -LiteralPath $item 'G:\path\720p' | |
} elseif ($item.Name -like "*1080p*") { | |
Move-Item -LiteralPath $item 'G:\path\1080p' | |
} else { | |
Write-Host "The path did not match what was expected" | |
Write-Host $item.Name | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment