title: How to speed up Powershell Get-Childitem over UNC
body: <p><code>DIR</code> or <code>GCI</code> is slow in Powershell, but fast in CMD. Is there any way to speed this up?</p>
  
  <p>In CMD.exe, after a sub-second delay, this responds as fast as the CMD window can keep up</p>
  
  <pre><code>dir \\remote-server.domain.com\share\folder\file*.*
  </code></pre>
  
  <p>In Powershell (v2), after a 40+ second delay, this responds with a noticable slowness (maybe 3-4 lines per second)</p>
  
  <pre><code>gci \\remote-server.domain.com\share\folder\file*.*
  </code></pre>
  
  <p>I'm trying to scan logs on a remote server, so maybe there's a faster approach.</p>
  
  <pre><code>get-childitem \\$s\logs -include $filemask -recurse | select-string -pattern $regex
  </code></pre>