title: Get Latest Version of Folder from TFS, using Powershell
body: <p>I am trying to "<strong>Get Latest Version</strong>" of a particular folder from TFS, using Powershell.</p>
  
  <p>I have installed the TFS Snappin, and have been using TFS Power Tools cmdlets in PowerShell (such as Get-TfsChildItem and Select-TfsItem etc) [<a href="https://stackoverflow.com/questions/1050689/how-do-i-set-up-tfs-powershell-snapin">How do I set up TFS PowerShell Snapin</a> ], and have gone through their documentation (which I didn't find explanatory enough!).</p>
  
  <p>Confused, on the exact cmdlet to use, when I am trying to get the latest version of an entire Folder structure from TFS, that is mapped to my local drive (<em>and not just a changeset or ChildItem</em>).</p>
  
  <p>Example : 
  Tfs Path - $/APD-RepairSolutions/Main/Database</p>
  
  <p>Mapped  path - D:\TFS\APD-RepairSolutions/Main/Database.</p>
  
  <p>I want a code, that would iteratively get the latest version of the entire folder <em>Database</em>,( that has number of tables,stored procedures etc.) </p>
  
  <p>I am using ..    </p>
  
  <pre><code>PS D:\Tfs\APD-RepairSolutions\Main\Database&gt; $server=Get-TfsServer -Name http://tfs:8080/tfs
  
  PS D:\Tfs\APD-RepairSolutions\Main\Database&gt; Get-TfsChangeset -Recurse -Server $Server
  </code></pre>
  
  <p>Not helping my case - as it is only returning the latest changeset in the current directory.</p>