Renaming Files with PowerShell
I need to rename a bunch of files at once in Windows PowerShell. I read
the HTG article here and it helped a little.
My problem is that It will only rename files in the top of the directory,
nothing deeper. For example: There is FOLDER A and inside FOLDERA is a
document and FOLDER B. Inside FOLDER B is another document. Both folders
and both documents need to be renamed. The way it is working now is that
FOLDER A, the document in FOLDER A, and FOLDER B are being renamed, but
not the document inside FOLDER B.
My current code is:
Dir | Rename-Item –NewName { $_.name –replace " ","_" }
Thanks for the help!
No comments:
Post a Comment