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>") }

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

Did you find this post useful? Show some love!
Classic DEV Post from Apr 27

What is your personal Programming ethics?

...

READ POST
Follow @jeffreyuvero to see more of their posts in your feed.
Meghan 🎩
21. Student. Dreamer. Doer. On a mission to change the world with code. she/her
More from @nektro
Safari is the New Internet Explorer
#javascript #safari #webdev #productivity
Trending on dev.to
Please Don't Answer This Question
#culture #productivity
Extend your LIMITS rather than your AMBITIONS
#productivity #growth #lifestyle #success
Domain Driven Design for Everyone Else
#ddd #productivity #learning
What are your programming hype songs?
#discuss #music #productivity
Fast-track to a new language for an experienced programmer
#career #computerscience #productivity
Automating My Newsletter Generation with MailChimp, Google Sheets, and AWS Lambda
#aws #serverless #productivity #showdev
The Shell Introduction I Wish I Had
#shell #productivity #beginners #bash