title: How to pass or pipe the results of tree to Powershell?
body: <p>How can an array of files, as found through <code>tree</code>, be populated?</p>
  <pre><code>posh&gt; 
  posh&gt;  tree ./  | Get-Item
  
      Directory: /home/nicholas/powershell
  
  Mode                 LastWriteTime         Length Name
  ----                 -------------         ------ ----
  d----           2/21/2021  5:42 PM                regex
  Get-Item: Cannot find path '/home/nicholas/powershell/regex/├── a.log' because it does not exist.
  ..
  Get-Item: Cannot bind argument to parameter 'Path' because it is an empty string.
  Get-Item: Cannot find path '/home/nicholas/powershell/regex/0 directories, 16 files' because it does not exist.
  
  posh&gt; 
  </code></pre>
  <p>This example has no sub-directories, but for more complex directories, with sub-directories, looking to capture, for each file, its full path and filename.</p>
  <p>Specifically, to then <a href="https://stackoverflow.com/q/66308742/4531180">search</a> the files -- but the question is of a somewhat general nature.</p>
  <p>see also:</p>
  <p><a href="https://stackoverflow.com/q/27447014/4531180">Use PowerShell to generate a list of files and directories</a></p>
  <p><a href="https://superuser.com/q/1270040/977796">https://superuser.com/q/1270040/977796</a></p>