-
-
Save alane019/7a3c6c78786c5a9fe958d27283faae7b to your computer and use it in GitHub Desktop.
Powershell script to bulk replace spaces with underscores in a directory of files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dir | Rename-Item –NewName { $_.name –replace “ “,”_” } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: Replace one character with another (e.g., spaces with underscores), for a directory of folders, use the following snippet
Get-ChildItem -Directory | Rename-Item –NewName { $_.name –replace “ “,”_” }
Usage: First navigate to this directory in powershell terminal. Run as-is.