title: Powershell and winrar command line
body: <p>So after digging around for a day or so I have found not much information about powershell and extracting files with winrar's command line.</p>
  
  <p>My difficulty lies with the actual execution of the arguments and command line.</p>
  
  <p>Here is my simple code so far:</p>
  
  <pre><code>$WinRar = "C:\Program Files\WinRAR\winrar.exe"
  
  #filter through files looking for zip files.
  $path = get-ChildItem -filter "*.zip" -path A:\testfolder\ -recurse
  
  #test to see if it is actually filtering and showing correct results:
  write-host = $path | format-table directory
  
  #arguments :: x (extract) y(presume yes) r(recurse subdir) 
  &amp;$WinRar x -y -r "$path" A:\Testfolder\
  
  
  
  read-host "press to exit"
  </code></pre>
  
  <p>I'm pretty new to powershell and seem to be catching on pretty quick but I'm assuming I have got this completely wrong as the code executes but it doesn't extract. So I guess it errors out somewhere with the command line and I cant see what it is doing.</p>
  
  <p>Are they any suggestions or tips that can point me in the right direction? </p>
  
  <p>I have tried many variations of the $winrar command with no luck except for the part if I replace $path with the actual file path it works.. which isn't what I need :P</p>