I have several configuration files on Windows Server 2008 nested like such:
C:ProjectsProject_1project1.config
C:ProjectsProject_2project2.config
In my configuration I need to do a string replace like such:
<add key="Environment" value="Dev"/>
will become:
<add key="Environment" value="Demo"/>
I thought about using batch scripting, but there was no good way to do this, and I heard that with PowerShell scripting you can easily perform this. I have found examples of find/replace, but I was hoping for a way that would traverse all folders within my C:Projects directory and find any files that end with the '.config' extension. When it finds one, I want it to replace my string values.
Any good resources to find out how to do this or any PowerShell gurus that can offer some insight?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…