title: Replace characters with incrementing value
body: <p>I'm trying to figure out how to replace a certain string that repeats itself multiple time in a txt file with an incrementing value.</p>
  
  <p>What I try to achieve is the following:</p>
  
  <p>I have multiple HTML links in a table, each of the links have the exact same ending i.e.: XYZ</p>
  
  <p>I want to change XYZ to 1, 2, 3, 4, 5 and so on... using PowerShell.</p>
  
  <pre><code>(Get-Content c:\temp\test.txt).replace('XYZ', 'MyValue') |
      Set-Content c:\temp\test.txt
  </code></pre>
  
  <p>It is the 'MyValue' part of using an incrementing number for each replacement I'm not sure how to achieve it.</p>