title: Replacing strings with values from an Excel Spreadsheet
body: <p>I have a requirement to edit all files within a folder with 2000 subfolders. The files and the folders that they reside in share the common quality of having the computer name listed. The files listed have the exact same variables within them that need to get changed. </p>
  
  <p>I am attempting to use an excel spreadsheet that has 3 columns; computer name, IP address, and MAC address. I am attempting to use this spreadsheet to find and replace the variables based upon the computer name.</p>
  
  <p>For example, if the script finds folder computer1 with files computer1.txt computer1.abc, it will then find the variables within it and replace them with the computer name, IP address, and MAC address listed within the spreadsheet that correspond with the computer name.</p>
  
  <p>So far I have managed to create a script to find the variables needed within the files and replace them.</p>
  
  <pre><code>  get-childItem -path "$env:userprofile\Desktop\Test\Computers\*\*.*" -recurse | % `
  {
  $filepath = $_.FullName;
  (get-content -path "$filepath") -replace '&lt;HOST_NAME&gt;&lt;/HOST_NAME&gt;', '&lt;HOST_NAME&gt;TEST&lt;/HOST_NAME&gt;'  | set-content $filepath -Force
  }
  </code></pre>
  
  <p>As you can see, the above changes everything to the same value, if I do a section for each computer, that's a lot of manual typing. </p>
  
  <p>I am assuming an array would be used but I am unsure on how to incorporate this into my current script. Any assistance would be appreciated.</p>