title: How to run PowerShell command in R?
body: <p>For example, this PowerShell command returns the top 5 largest files in the directory:</p>
  <pre><code>gci -r |sort Length -desc |select fullname -f 5
  </code></pre>
  <p>Is it possible to run it in R and assign it to a variable?</p>
  <p>I tried this:</p>
  <pre><code>system(&quot;gci -r|sort Length -desc|select fullname -f 5&quot;)
  Warning message:
  running command 'gci -r|sort Length -desc|select fullname -f 5' had status 127 
  </code></pre>
  <p>Shouldn't I use <code>system()</code> here?</p>