title: Powershell capture first filename from a folder
body: <p>Newbie to powershell
  I need to capture first file name from a directory. However my current script captures all file names. Please suggest changes to my code below.</p>
  
  <pre><code>#   Storing path of the desired folder
  $path = "C:\foo\bar\"
  $contents = Get-ChildItem -Path $path -Force -Recurse
  $contents.Name
  </code></pre>
  
  <p>The result is following</p>
  
  <pre><code>test-01.eof
  test-02.eof
  test-03.eof
  </code></pre>
  
  <p>i just want one file (any) from this list. So expected result should be</p>
  
  <pre><code>test-01.eof
  </code></pre>