title: Write bytes to a file natively in PowerShell
body: <p>I have a script for testing an API which returns a base64 encoded image. My current solution is this.</p>
  
  <pre><code>$e = (curl.exe -H "Content-Type: multipart/form-data" -F "image=@clear.png" localhost:5000)
  $decoded = [System.Convert]::FromBase64CharArray($e, 0, $e.Length)
  [io.file]::WriteAllBytes('out.png', $decoded) # &lt;--- line in question
  
  Get-Content('out.png') | Format-Hex
  </code></pre>
  
  <p>This works, but I would like to be able to write the byte array natively in PowerShell, without having to source from [io.file].</p>
  
  <p><em>My</em> attempts of writing $decoded in PowerShell all resulted in writing a string-encoded list of the <strong>integer</strong> byte values. (e.g.)</p>
  
  <pre><code>42
  125
  230
  12
  34
  ...
  </code></pre>
  
  <p>How do you do this properly?</p>