"$(Date:yyyyMMdd)" is a token for Build number format, not a variable . So you cannot use it in the build steps.
The alternative way to do this is to set the "Build number format" under "General" tab to "$(Date:yyyyMMdd)", the variable "$(Build.BuildNumber)" will be filled with the value of "$(Date:yyyyMMdd)". And then you can use "$(Build.BuildNumber)" variable in the build steps.
As the error tells you, date
is not a function. You could set the -fileName
parameter in your CompressFile
script to:
Param(
[string]$fileName = 'Package{0}' -f (Get-Date).ToString('yyyyMMdd')
)
And omit the parameter in the TFS VNext argument list (you can still overwrite it).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.