0

I have been given a task to remove spaces in file and folder names for 1 TB worth of data. I have test files and folders on a laptop I am using.

I can get all the top-level folders and files to remove the spaces from the names. However, I'm not sure how to get it to go into all subfolders and keep going.

The code I am using is :

$Files = Get-ChildItem -Path "C:\users\admin2\desktop\ProjectTest" |
         Rename-Item -NewName { $_.Name -replace ' ','' }
mklement0
  • 382,024
  • 64
  • 607
  • 775
K.Sutton
  • 9
  • 1

0 Answers0