Issue
how can we change the name of files of build artifacts in azure devops below is the picture. i want to change the name of files in drop, want to add build number with the names. eg WebApplication1_(buildNumber)
i use the sample project from visual studio, asp.core.webapp
also tell me from which file artifact files take the name of the file "WebApplication1". i am using azure devops.
Solution
You can just rename your files through PowerShell before publish them:
$projectName = 'WebApplication1'
$projectNewName = 'WebApplication1_$(Build.BuildNumber)'
Get-ChildItem -File -Recurse -Path $(build.artifactstagingdirectory) "$projectName.*" | Rename-Item -NewName { $_.Name -replace "$projectName","$projectNewName" }
The example:
The result:
Answered By - Shamrai Aleksander Answer Checked By - Mary Flores (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.