Thread: Find/Replace
View Single Post
Old 03-22-2007   #1 (permalink)
eric.eickhoff@sbcglobal.net


 
 

Find/Replace

Hello,

I am just learning PowerShell and need a little guidance.

What I am trying to do is to search a directory recursively for files
that contain a text string and modify the file(s) by replacing that
string with other text.

To do the search, I can use:

dir -r c:\temp\* | Select-string "xyz"

but from there, I am not sure how to go about doing the replace in
each file found.

Can anyone point me in the right direction to accomplish this?

Thanks,

-e

My System SpecsSystem Spec