Rename case
I am trying to rename a folder with the same name but in a different case. Consider this simple code:
Rename-Item -Path C:\files -NewName C:\Files
Returns the error "The source and destination path must be different."
Also I tried this:
$item = 'C:\files'
Rename-Item -Path $item -NewName ($item.Name -replace 'files', 'Files')
What does not work. Also the parameter -force
doesn't help.
What am I missing? Thank.
+3
source to share