title: where to place the out-file cmdlet ?
body: <p>I was doing a small script in the past which searches for big files in a specific location. Now I want to create a .txt file with my result. But unfortunately I didn't manage to place the cmdlet correctly. I outfiled other things but, here I have some trouble.</p>
  
  <pre><code>get-childitem  "c:\projects" -recurse | where {$_.length -gt 50mb } | foreach-object {write-host $_.FullName  ("{0:N2}" -f ($_.Length / 1MB)) "MB" -ForegroundColor "green" }
  </code></pre>
  
  <p>I tried too tee the object and outfile the varible, I tried to put the out-file in the end and i tried to put it before I format the size.</p>
  
  <p>It was only working when I placed it before the formatting. But I'd love to have formatted sizes in my .txt  , on the other places it just created a blank .txt file.</p>