Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Powershell script to bulk replace spaces with underscores in a directory of files
Dir | Rename-Item –NewName { $ –replace ,_ }
Copy link

chitrakakkar commented Apr 6, 2018

How do you do that for a directory of folders?

Copy link

MCKPRO commented Jul 17, 2018

Get-ChildItem -Directory | Rename-Item –NewName { $ –replace “ “,”_” }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment