blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

Stuart Preston's Blog

Mostly about Visual Studio Team System, Team Foundation Server, Engineering Practices and Application Lifecycle Management.

Cleaning up multiple defunct Team Projects within Team Foundation Server

If, like us at Conchango you are developing Reports and Process Templates for Team Foundation Server, you will end up with a lot of defunct Team Projects that are taking up space for no reason on your development server (and also slowing down the Warehouse refresh cycle).

Looking for an easy way to clean up, I found the command-line tool TFSDeleteProject.exe (typically in %ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies or Tools depending on whether you are on Beta 3 Refresh or a later build...) and cobbled together this batch file to call it.  I thought I'd share as people forget the power of "FOR /L" in a batch file and start using funkier things like Monad ;)

The following batch file will delete Projects test1 to test100 inclusive (and associated Build items, Work Items, Reports deployed to Reporting Services and the WSS site) when run on the application server:

@echo off
c:
cd\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
set TEAMPROJECTPREFIX=test
FOR /L %%G IN (1,1,100) DO echo Deleting Project: %TEAMPROJECTPREFIX%%%G && tfsdeleteproject.exe /q /force /TeamFoundationServer:%COMPUTERNAME% %TEAMPROJECTPREFIX%%%G

If you are interested, this could also be achieved in one line of Monad (Beta 2) script as follows ;)

$prefix="test";cd "\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies";for($x=1;$x -le 100;$x++){echo "Deleting Project $prefix$x";.\TFSDeleteProject.exe /q /force /TeamFoundationServer:$env:COMPUTERNAME $prefix$x;}

 

Published 06 January 2006 14:00 by Stuart.Preston

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Personal Edition), by Telligent Systems