steps:
- task: PowerShell@2
  inputs:
    targetType: inline
    script: |
      $date = (Get-Date).ToString("yyMMdd")
      $previousBuildNumber = $($env:BUILD_BUILDNUMBER) 

      $buildNumberParts = $($env:BUILD_BUILDNUMBER) -split '\.' 
      $revision = [int]$buildNumberParts[$buildNumberParts.Length-1] 
      $newBuildNumber = "$date$revision"
      Write-Host "##vso[build.updatebuildnumber]$newBuildNumber" 