Skip to content

Instantly share code, notes, and snippets.

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

chitrakakkar commented Apr 6, 2018

How do you do that for a directory of folders?

@MCKPRO
Copy link

MCKPRO commented Jul 17, 2018

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

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