Blogs:

Deleting Moldy Shelvesets

Mark

October 20, 2012 / 1 Comment

If you have had a Team Foundation Server (TFS) instance running for any significant length of time you undoubtedly have old shelvesets lying around from other developers (surely you wouldn’t have done this) that have long ago expired and although moldy, they have not disintegrated. Consider cleaning them up using the following short PowerShell script from Kelly Adams:

Get-TfsShelveset -Owner * | 
?{ $_.CreationDate -lt "7/1/2012" } | 
%{ Remove-TfsShelveset -ShelveSet ("{0};{1}" -f $_.Name, $_.OwnerName) }

Note:

  • The “-Owner *” on the Get-TfsShelveset command is what finds shelvesets from other developers rather than just yourself.
  • You need to have the Team Foundation Server PowerTools installed and the snapin loaded (using Add-PSSnapin Microsoft.TeamFoundation.PowerShell) in an x86 PowerShell command prompt.
AUTHOR: CATEGORY: Blog, PowerShell, TFS

One Response to “Deleting Moldy Shelvesets”

  1. Mark Hill says:

    This would be good to have for old workspaces as well.

Leave a Reply


Contact Us
Email: info@IntelliTect.com
Phone: (509) 315-3400




Testimonials

Great session! The speaker (Mark) was outstanding plus he had a lot of great information. One of the best sessions I attended at this years Tech-ED.
- Seminar Attendee, TechEd 2011, Atlanta, GA
CONTACT US: (509) 315-3400 | Info@IntelliTect.com