Wednesday 6 November 2024

Rename powershell with case sensitive

I ran this on powershell/linux to fix some case sensitive file names. I know that's a weird combo but I can't remember any bash.
$files = Get-ChildItem -Name *.PNG -recurse -Path ./ | grep .PNG foreach($file in $files) { $newName = $file -replace '.PNG','.png' git mv $file $newName; }
Sure it not pretty but it works for me!

No comments:

Post a Comment