12

I have a build and pipeline setup to build a solution and then upload the finished .exe file via ftp upload to my website. Everything works fine and I have it setup to make a new folder named $Build.BuildNumber (20181218.4 for example) with the .exe file in it so I can keep an archive of my finished builds.

Now I want to write the BuildNumber to a text file sitting somewhere in the root directory with a static path/url so my programms can read the file and get the newest build number and download the newest .exe.

How can I automate the process of creating such a text file with Azure DevOps Pipelines?

Henk van Boeijen
  • 7,357
  • 6
  • 32
  • 42
Lukas
  • 169
  • 1
  • 2
  • 8

1 Answers1

21

You can create a text file using powershell task.

use following commands inside powershel task

New-Item pathtoFile\test.txt
Set-Content pathToFile\test.txt '$(Build.BuildNumber)'
Fabian Bigler
  • 10,403
  • 6
  • 47
  • 70
Channa
  • 3,267
  • 7
  • 41
  • 67