title: Powershell Arrays to text file
body: <p>I borrowed code from Powershellbros.com which displays the requested data is returned properly in the output pane, but I want to output it to a txt file.</p>
  
  <p>I got the code from <a href="https://www.powershellbros.com/powershell-tip-of-the-week-get-sccm-client-version-remotely/" rel="nofollow noreferrer">https://www.powershellbros.com/powershell-tip-of-the-week-get-sccm-client-version-remotely/</a> and want the better formatted version. The way I ended the script creates the file, but nothing is in it (1KB).</p>
  
  <pre><code>if ($Array) {
      return $Array 
  }
  &amp; $Array Out-File -Append c:\temp\Version.txt
  </code></pre>