Created
July 29, 2020 11:11
-
-
Save susemeee/3d0d09d975f5bd9b60fa924f25db5100 to your computer and use it in GitHub Desktop.
Revisions
-
susemeee created this gist
Jul 29, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ $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 }