title: Powershell pipeline both remove-item and call function
body: <p>I have a powershell script that I use to clean up a build area before fetching files from SVN again. I want to improve logging by keeping a record of what was cleaned up. </p>
  
  <pre><code>     Get-ChildItem .\ _
      -Include bin,obj,Debug,ipch,Resources _
      -Exclude "*.png","*.bmp","*.jpg","*.htm*","*.xml","*.fl*","*.css" _
      -Recurse _
     | foreach ($_) { Remove-Item $_.fullname -Force -Recurse} 
  </code></pre>
  
  <p>What I would would like to insert here is some type of Format-Table for the foreach process to get the fullname property to output to $bldLog. I have a function that formats a message for the build log with a date time stamp so I just call WriteToLog $msg -STATUS 'INFORMATION'</p>
  
  <p>I have been trying to wrack my brain around this for a couple of days now to get both writeToLog and to get Remove-Item in a pipleLine but without success. Is such a process possible or do I just forget the pipeline and go oldschool?</p>