Note: this is for the Azure DevOps Classic UI, not YAML. I'm creating an Azure Release Pipeline ... how do we add a formatted date to a filename? At work, we are still using the Classic UI, and YAML is not a choice at this moment.
In an Archive task, I want to append a formatted date to the zip filename, so the output zip name might be MyBackupFile_20211022_0805.zip
, (MyBackupFile_yyyyMMdd_HHmmss).
On a separate project, in a Build Pipeline, in the "Variables" tab, I successfully created a variable assigning it a value of a formatted date, like this, , but this does not work in a Release Pipeline.
I also tried adding a variable using Powershell like the answer found here, but it doesn't work. EDIT: After using the technique in the link, it now works ... I wonder if the problem was creating the variable in the "Variables" tab, then using that same variable in the powershell? Or maybe it was a typo?