Say I want to rename files in a file tree and add an extension. I used this powershell command, but there is a bug: it adds the extension twice; why ? how to correct this ?
get-childitem * -recurse -exclude *.h | where { !$_.PSIsContainer } |
rename-item -newname {$_.name -replace '(\w*)','$1.h'} -whatif