I want to use a custom tfs variable like this:
MergedVersion: $(BuildVersion.Major).$(BuildVersion.Minor).$(Date:yy)$(DayOfYear)$(Rev:.r)
My pro
Use following script in a PowerShell Task in your build definition
$date=$(Get-Date -Format 'yy');
Write-Host "##vso[task.setvariable variable=Today]$date"
Then you can use $(Today) in your subsequent build tasks. However, usage like $(Today:yy) with format is not possible as it is supported only in build number format.