DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 970,177 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Meghan (she/her)
Meghan (she/her)

Posted on

Search/replace file names in Powershell

Posting a command I recently found that allows you find/replace file names in Powershell on Windows. <search> and <replace> both accept a regex or you can also add the -LiteralPath option to rename-item

get-childitem *.txt | foreach { rename-item $_ $_.Name.Replace("<search>", "<replace>") }
Enter fullscreen mode Exit fullscreen mode

In a world where Denvercoder69 actually does come back and reply to that blog post.

Top comments (1)

Collapse
 
nektro profile image
Meghan (she/her) Author
get-childitem * | foreach { rename-item -LiteralPath $_ $_.Name.Replace("", "") }

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. πŸ›