Created
August 23, 2022 20:10
-
-
Save dcabines/51ecb7c4cd70f5d18387f877c643f162 to your computer and use it in GitHub Desktop.
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
$originalsFolder = 'originals' | |
$resizedFolder = 'resized' | |
$reorganizedFolder = 'reorganized' | |
$originals = Get-ChildItem -Path $originalsFolder -Recurse -Include *.jpg | |
foreach ($original in $originals) { | |
$resized = Get-ChildItem -Path $resizedFolder -Recurse -Include $original.Name | |
$destination = ($resized.FullName).Replace($resizedFolder, $reorganizedFolder).Replace($resized.Name, "") | |
New-Item $destination -Type Directory | |
Copy-Item $original -Destination $destination | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment