title: Handling Path Too Long Exception with New-PSDrive
body: <p>I am recursing a deep folder structure in order to retreive all folder paths like so:</p>
  
  <pre><code>$subFolders = Get-ChildItem $rootFolder -Recurse -Directory  -ErrorVariable folderErrors | Select-Object -ExpandProperty FullName
  </code></pre>
  
  <p>NOTE: $rootFolder in my case is a network share.  i.e. "\\server\DeptDir$\somefolder"</p>
  
  <p>The <code>$folderErrors</code> variable is correctly capturing all the FileTooLong exceptions so I want to create new PSDrives using the long Paths in order to recurse those long paths.  </p>
  
  <p>So I create a new PSDrive using this cmdlet:</p>
  
  <pre><code>new-psdrive -Name "long1" -PSProvider FileSystem -Root $folderErrors[0].CategoryInfo.TargetName
  </code></pre>
  
  <p>However, after creating a new PSDrive I am still getting PathTooLong Exceptions.  </p>
  
  <pre><code>PS C:\&gt;&gt; cd long1:
  PS long1:\&gt;&gt; dir
  dir : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
  At line:1 char:1
  + dir
  + ~~~
      + CategoryInfo          : ReadError: (\\svr01\Dep...\Fibrebond ECO\:String) [Get-ChildItem], PathTooLongException
      + FullyQualifiedErrorId : DirIOError,Microsoft.PowerShell.Commands.GetChildItemCommand
  </code></pre>
  
  <p>I see no other way around this problem.  Am I doing something incorrectly?  Why is the new PSDrive throwing PathTooLong when I am creating a drive at the location where the path is too long?</p>
  
  <p>Thanks</p>