title: Powershell System.IO.StreamReader Read method
body: <p>I'm trying to learn how to use streams in PowerShell. I've been able to understand all of the methods in StreamReader except the Read(char[], In32, In32).  </p>
  
  <p>I've only been able to get this method to work using</p>
  
  <pre><code>[char[]]$ca = 'a','b','c','d','e'    
  $reader = [System.IO.StreamReader]::new($inputFile)
  $reader.Read($ca,0,$ca.Length)     
  $reader.Close() 
  </code></pre>
  
  <p>My question is how can use the Read method without creating an array before hand?  Do I have to create and array of 1024 chars if That is the amount of data I want to read into the buffer?</p>
  
  <p>Thanks</p>