I have a build pipeline and the first task is a PowerShell script which sets some variables. I have the git command to get the latest tag from a branch in the repo.
git tag -l v* | tail -n1
I am trying to use this to add to the build name. The command above has the output of: v1.4.0
However when I run:
$AppVersion= (git tag -l v* | tail -n1)
Write-host $AppVersion
I am getting the following error:
tail : The term 'tail' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
tail -n 1
equivalent isSelect-Object -Last 1
. – AdminOfThings