Created
July 29, 2020 11:11
-
-
Save susemeee/3d0d09d975f5bd9b60fa924f25db5100 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
$src = ".\goog" | |
$dest = ".\goog2" | |
$num=1 | |
Get-ChildItem $src -Recurse -Include *.gif, *.jpg, *.jpeg, *.png, *.bmp, *.heic, *.heif, *.mov, *.mp4, *.webp, *.avi, *.tif, *.flv, *.mts | ForEach-Object { | |
$nextName = Join-Path -Path $dest -ChildPath $_.name | |
while(Test-Path -Path $nextName) | |
{ | |
$nextName = Join-Path $dest ($_.BaseName + "_$num" + $_.Extension) | |
$num+=1 | |
} | |
$_ | Move-Item -Destination $nextName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment