Task to rename a file?
How can I rename a file in a release definition in Visual Studio Team services? Is there a built in or marketplace task available or otherwise, how can this be achieved?
Answer:
1) Add the "Inline Powershell" task from the marketplace
2) Enter the following Powershell in the text area
Param
(
[string]$pathToFileToRename
)
Rename-Item $pathToFileToRename NewName.txt
3) Enter any required arguments in the arguments text box (you can use environment variables) eg
pathToFileToRename $(System.DefaultWorkingDirectory)/somepath/CurrentName.txt
使用“运行命令行”任务或在PowerShell脚本中执行该任务,并在您的版本中调用脚本。
链接地址: http://www.djcxy.com/p/36230.html上一篇: 在Javascript Web App中与新的Facebook像素进行高级匹配
下一篇: 任务重命名文件?