title: Powershell convert string to array
body: <p>How do I change:</p>
  
  <pre><code>$Text = "Apple Pear Peach Banana"
  </code></pre>
  
  <p>to</p>
  
  <pre><code>$Text = @("Apple", "Pear", "Peach", "Banana")
  </code></pre>
  
  <p>I am planning to feed the array to a <code>foreach</code> loop. The input the user is prompted to enter fruit with a space between (I will use <code>Read-Host</code> for that). So then I need to convert a space-separated string to an array for the <code>foreach</code> loop.</p>
  
  <p>Thank you...</p>