#Enable powershell script.
Set-ExecutionPolicy RemoteSigned
#Add environment variables temperally.
$env:path+=";C:\Program Files\SlikSvn\bin";
$env:path+=";C:\Windows\System32";
$env:path+=";C:\WINDOWS\system32\windowspowershell\v1.0";
#Define the path of TFS project, SVN project and redirect temp file.
$tfsFolder="C:\project\tfs";
$svnFolder="C:\project\svn";
$tempFolder="C:\";
#Get the latest code forcely from TFS server.
tf get $tfsFolder /force /recursive;
#Update the code from SVN server.
svn update $svnFolder;
svn cleanup $svnFolder;
#Compare the two folders of TFS project and SVN project. Redirect the result to a temp .txt file.
tf folderdiff $tfsFolder $svnFolder /recursive /noprompt /view:targetonly > $tempFolder\targetonly.txt
tf folderdiff $tfsFolder $svnFolder /recursive /noprompt /view:sourceonly > $tempFolder\sourceonly.txt
#Copy the specific fil
用poweshell从TFS获取最新代码,并提交到SVN服务器上
最新推荐文章于 2020-12-24 13:56:23 发布
本文介绍如何通过PowerShell脚本从TFS获取最新代码,并将其更新到SVN服务器。首先设置环境变量,然后分别获取TFS和SVN的最新代码。接着比较两个项目文件夹的差异,将TFS中的特定文件复制到SVN,并删除或添加SVN中缺失或新增的文件。最后,提交SVN的更改。
摘要由CSDN通过智能技术生成