PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, November 21, 2022

[FIXED] how can we change the name of files of build artifacts in azure devops

 November 21, 2022     asp.net-core, azure-devops, visual-studio     No comments   

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. enter image description here eg WebApplication1_(buildNumber)

i use the sample project from visual studio, asp.core.webapp enter image description here

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:

enter image description here

The result:

enter image description here



Answered By - Shamrai Aleksander
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing