title: Powershell to list files and have the user select one
body: <p>I have a folder "D:\PROD\transfert" containing a list of files.</p>
  
  <p>I want to write a Powershell script that will list the files and let the user chose one, the script will then perform actions on the selected file. Idealy I want the path of the selected file to be stored in a variable.</p>
  
  <p>Here is the output wanted :</p>
  
  <pre><code>&gt;Select a file :
  [1] file1.zip
  [2] file2.zip
  [3] file3.zip
  &gt;
  </code></pre>
  
  <p>All i can do right now is listing the files with no number before :</p>
  
  <pre><code>Get-ChildItem C:\PROD\transfert | % { $_.FullName }
  </code></pre>
  
  <p>Thanks !</p>