title: use the git tags within powershell
body: <p>We are using git &amp; VSTS fro our CI/CD, also we got some guideline from our development team regarding the git's tags.</p>
  
  <p>if we are going to deploy the code somewhere then we need to add a tag tat follow this format :
  "Environment ver version"</p>
  
  <p>for example:
  prod ver 1.0.23 
  tst1 ver 2.0.45
  tst2 ver 2.0.46
  dev ver 2.0.47</p>
  
  <p>I like to have a script that read the tag (only in the latest commit) and writes a message</p>
  
  <p>$tag  = SomeHowGetTheTags()</p>
  
  <pre><code>if ( $tag -like 'dev*')
  {
  Write-Host "this is for the development Environment "
  }
  </code></pre>
  
  <ul>
  <li>Question:
  How can I get the latest tags from git and ignore the historical tag? like the tags from last week or yesterday.</li>
  </ul>