title: How to pipe binary data in PowerShell
body: <p>I tried to extract the Master Boot Record (MBR) via mmcat.exe in PowerShell and PowerShell ISE (Version 5.1.1). The outputted binary data is always bigger than 512 bytes. PowerShell 6.1.1 has still this problem.</p>
  
  <pre><code>$mmcat = "C:\Tools\sleuthkit\bin\mmcat.exe"
  &amp; $mmcat -t dos "$EWF_IMAGE" 0 &gt; "$OUTPUT\Disk-Geometry\MBR.bin"
  </code></pre>
  
  <p>The issue is well decribed here:
  <a href="https://brianreiter.org/2010/01/29/powershells-object-pipeline-corrupts-piped-binary-data/" rel="noreferrer">PowerShell’s Object Pipeline Corrupts Piped Binary Data</a></p>
  
  <p>Do you know a workaround for this? </p>