title: Use Powershell to comment out a 'codeblock' in a text file?
body: <p>I'm trying to comment out some code in a massive amount of files</p>
  
  <p>The files all contain something along the lines of:</p>
  
  <pre><code>    stage(&amp;apos;inrichting&amp;apos;){
          steps{
                build job: &amp;apos;SOMENAME&amp;apos;, parameters: param
                build job: &amp;apos;SOMEOTHERNAME&amp;apos;, parameters: param
                echo &amp;apos;TEXT&amp;apos;
          }
      }
  </code></pre>
  
  <p>The things within the <code>steps{ }</code> is variable, but always exists out of 0..N 'echo' and 0..N 'build job'</p>
  
  <p>I need an output like:</p>
  
  <pre><code>    //stage(&amp;apos;inrichting&amp;apos;){
      //   steps{
      //        build job: &amp;apos;SOMENAME&amp;apos;, parameters: param
      //        build job: &amp;apos;SOMEOTHERNAME&amp;apos;, parameters: param
      //        echo &amp;apos;TEXT&amp;apos;
      //  }
      //}
  </code></pre>
  
  <p>Is there any good way to do this with PowerShell? I tried some stuff with pattern.replace but didn't get very far.</p>
  
  <pre><code>$list = Get-ChildItem -Path 'C:\Program Files (x86)\Jenkins\jobs' -Filter config.xml -Recurse -ErrorAction SilentlyContinue -Force | % { $_.fullname };
  foreach ($item in $list) {
  ...
  }
  </code></pre>