Some handy command script for TFS

Below mentioned scripts are utility scripts for managing TFS

Note : All text inside angular brackets are comments like : <COMMENTS>

Script #1: Get latest script
#cd C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE <path of
TF.exe>
#TF.exe get $/___TfsRootPath____/__BranchPath___ /recursive /force /
nonprompt > C:\GetLatestDailyFile.log <the path after greater then is
log path>

Script #2: Rebulid Solution script
#cd C:\WINNT\Microsoft.NET\Framework\v4.0.30319  <path of MSBuild.exe>
#MSBuild.exe “C:\\SolutionName\\BranchName\\FolderName\
\ProjectName.csproj” /t:rebuild /p:Configuration=Release /
p:DebugType=none > C:\RebuildSolution.log

Script #3: Publish Website script
#cd C:\WINNT\Microsoft.NET\Framework\v4.0.30319  <path of MSBuild.exe>
#MSbuild.exe “C:\\SolutionName\\BranchName\\FolderName\
\ProjectName.csproj” “/
t:ResolveReferences;_CopyWebApplication;publish” /
p:Configuration=Release /p:DebugType=none /p:OutDir=”\\DevServername\
\DevPath\\ProjectFolder\\bin” /pWebprojectOutputDir=”\\DevServername\
\DevPath\\ProjectFolder” >> C:\PublishWebSite.log

Script #4 Xcopy all the files and over write eixsting files (related
to publishing)
#xcopy “\\SourceServer\\SourceFolder\*” “\\DestinationServer\
\DestinationFolder\” /s /i /Y >> C:\XCopyFiles.log

Script #5 remove read only attribute from an folder
#cd\
#attrib -R C:\ProjectPath\BranchPath\Assemblies\*.* /s

Script #6 Search string from the comments of checked-in code (install
TFS power tool first)
#tfs history /server:http://tfs.mycompany.com:8080 “$/Team project/
Development” /noprompt /recursive | findstr refactoring

Happy programming!

Advertisements

I am a Pragmatic Programmer Part 7

This is Part 7 of 7 part series inspired from the book Pragmatic Programmer, read Part 6 here:

  1. Use a Project Glossary: Create and maintain a single source of all the
    specific terms and vocabulary for a project.
  2. Start When You’re Ready: You’ve been building experience all your
    life. Don’t ignore niggling doubts.
  3. Don’t Be a Slave to Formal Methods: Don’t blindly adopt any technique
    without putting it into the context of your development practices and
    capabilities.
  4. Organize Teams Around Functionality: Don’t separate designers from
    coders, testers from data modelers. Build teams the way you build
    code.
  5. Test Early. Test Often. Test Automatically: Tests that run with every
    build are much more effective than test plans that sit on a shelf.
  6. Use Saboteurs to Test Your Testing: Introduce bugs on purpose in a
    separate copy of the source to verify that testing will catch them.
  7. Find Bugs Once: Once a human tester finds a bug, it should be the last
    time a human tester finds that bug. Automatic tests should check for
    it from then on.
  8. Build Documentation In, Don’t Bolt It On: Documentation created
    separately from code is less likely to be correct and up to date.
  9. Sign Your Work: Craftsmen of an earlier age were proud to sign their
    work. You should be, too.

This is last part of 7 part series.Thanks for reading!