title: Powershell print get-physicaldisk to a text file
body: <p>I need to get a list of kinds of hard drives all our company computer's use.  I figured the best way is to run a startup script that outputs the info to a text file.</p>
  
  <p>The problem I'm having is when printing to the text file. The get-physicaldisk works in the console, but when printing to a text file it prints something different.</p>
  
  <pre><code>$name = $env:COMPUTERNAME
  $disk = get-physicaldisk | format-table -Auto deviceID,Size,BusType,MediaType,Model
  
  New-Item -ItemType "file" -Path . -Name $name'.txt' -Value "$name `r`n$disk" -Force
  </code></pre>
  
  <p>What am I doing wrong?</p>