locked
I tried to replace characters for files in a folder and its sub-folders with a powershell command and kinda messed somethings up. RRS feed

  • Question

  • SO total noob to powershell. I used get-childitem -recurse | rename-item -newname { $_.name-replace ".","_"}. Not all but a lot of file and folder names look like this _____________. Am I screwed or is there a was to "undo" my screw up. I have the ConsoleHost_history.txt file 
    Sunday, October 13, 2019 12:04 AM

Answers

  • You have to specify "-File" to rename only the files.

    YOU cannot undo this so you will have to find a rename all back.


    \_(ツ)_/

    Sunday, October 13, 2019 1:25 AM

All replies

  • You have to specify "-File" to rename only the files.

    YOU cannot undo this so you will have to find a rename all back.


    \_(ツ)_/

    Sunday, October 13, 2019 1:25 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, November 8, 2019 2:00 PM