Remove old shelvesets

Today a customer asked me how to clean up old shelvesets.The October 2008 release of TFS Power Tool contains Get-TfsShelveset and Remove-TfsShelveset cmdlets. The issue is that if one passes the result of Get-TfsShelveset to Remove-TfsShelveset with pipeline, the owner information is ignored and the Remove-TfsShelveset cmdlet will attempt to look up shelveset created by the current user.

Fortunately, Remove-TfsShelveset recognizes owner in terms of “Remove-TfsShelveset –Shelveset name;domain\alias”. So one workaround is to first obtain a list of shelvesets with Get-TfsShelveset cmdlet, then computer the shelvesetspecs and invoke Remove-TfsShelveset understands. The below script will delete all shelvesets created before 90 days ago.

Get-TfsShelveset -server http://170112m3:8080 -owner * | 
Where-Object -Filter {$_.CreationDate -lt [DateTime]::Now.AddDays(-90)} |
ForEach-Object -Process { Remove-TfsShelveset -server http://170112m3:8080 -Shelveset
($_.Name+";"+$_.OwnerName) }

27 comments:

e cigarettes November 23, 2010 at 11:50 PM

Great codes and it do offer me a lot of help.keep on writing.Regards.

drupal theme March 14, 2011 at 3:07 AM

great post man, you have to done good job for me. this post will very much help to update my knowledge. I'm searching this code last 2 weeks now only i get the exact code..

dell latitude d610 battery April 18, 2011 at 11:35 PM

Hey You have done great job, really it's an very interesting blog found here.... I enjoyed your post. keep posting. Thanks very much for sharing it.

Stacey August 11, 2011 at 7:58 AM
This comment has been removed by the author.
play poker October 25, 2011 at 2:39 AM

i was searching the solution for removing shelve-sets for some days.Then your post really helped me.Thanks for sharing.

blackberry developers February 27, 2012 at 10:55 PM

Thank you for that piece of code. That was really useful for me. Can I implement it into my code?

Unknown June 13, 2012 at 5:20 AM

The codes you shared are really helpful.Thank you so much for sharing.

Kashmir Tour Packages | Software Company India | Budget Hotels in Ranchi

Blazer for travel January 30, 2013 at 8:10 PM

Thanks for the brilliant tutorial. I never thought I’d be able to set up Ubuntu, but it happened. I’m quite proud of myself, and grateful to you lol.Thanks you really helped me out! I even got it working!

fdhty April 23, 2013 at 6:44 PM

If I could rearrange the alphabet, I'd put Y and I together Runescape Gold, A lifetime of happiness! No man alive could bear it, Rune Scape Gold it would be hell on earth Buy Runescape Gold.

Good love makes you see the whole world from one person while bad love makes you abandon the whole world for one person Ultimate Game Card, Men love from overlooking while women love from looking up. If love is a mountain, then if men go up, more women they will see while womenwill see fewer men Cheap Minecraft Gift Code, if you leave me, please don't comfort me because each sewing has to meet stinging pain Ultimate Game Card.

fdhty April 23, 2013 at 6:44 PM

You laugh at me for being different, but I laugh at you for being the same RuneScape Gold, The consequences of today are determined by the actions of the past RS Gold, experience is a hard teacher because she gives the RS GP test first, the lesson afterwards.

If you can hold something up and put it down, it is called weight-lifting; if you can hold something up but can never put it down Cheap Minecraft Gift Code, Love makes man grow up or sink down Buy Xbox Live Points, I love you not for who you are, but for who I am before you, and successful in each endeavor Ultimate Game Card.

amelie adam August 17, 2013 at 6:51 PM

Shelving enables you to set aside the pending changes in your workspace to work on a higher-priority task or to share your code with another user for code...
Kiosk Manufacturers

baixar mobogenie July 12, 2015 at 6:52 PM

This article is really fantastic and thanks for sharing the valuable post.
----
i like play game jogos click online free and apply baixar facebook gratis online free and apply mobogenie baixar online free

five nights at freddy's download August 7, 2015 at 1:37 AM

I like how you think and the way you represent your views in this article.
----
facebook movil gratis | five nights at freddy's demo | facebook móvil

Prasanth March 27, 2017 at 10:40 PM
This comment has been removed by the author.
Hotel in Ranchi October 13, 2017 at 1:33 AM

Awesome! Its Really Helpful..

Accommodation in Ranchi October 13, 2017 at 3:07 AM

That is very interesting to read such entries as this one.

Hotels in Ranchi
Ranchi Hotels
Restaurant in Ranchi
Banquet Halls in Ranchi
Book hotels in Ranchi

Website Design Ranchi October 16, 2017 at 3:46 AM

Thats a very interesting post. I have been inspired. Thanks.
Software Company Ranchi
Ecommerce Website Design Ranchi
SEO Company Ranchi
Mobile Apps Development Ranchi

vivek kumar February 24, 2020 at 3:01 AM

Best IIT JEE Coaching in Patna, IIT JEE Institute in Patna, NEET Coaching in Patna
We are one of the reputed medical and engineering coaching centre in Patna. If you want to preparation of IIT, JEE, NEET, AIIMS Spriitjee is the best Institute for you. We provide best coaching classes for JEE Mains & JEE advance, NEET, AIIMS entrance exam by expert faculty.

vivek kumar February 26, 2020 at 8:46 PM

Best Ayurvedic Treatment Kolkata
Call Us at +91 9204900900, we offer a completely natural, chemical-free and safe slimming programme. Kerala Ayurveda have helped many by providing effective Ayurvedic Treatments for various health conditions and illnesses.

vivek kumar February 28, 2020 at 9:50 PM

Best Ayurvedic Treatment Kolkata, Ayurvedic Treatment Kolkata, Ayurvedic Doctors Kolkata
Call us at +91 9204900900,Best Ayurvedic Treatment Centre in Ranchi, India, Kerala Ayurveda Hospital specializes in Authentic Kerala Ayurvedic Treatments and Panchakarma Therapies. Listed as the best traditional Ayurveda treatment Centers in Ranchi, Kerala Ayurveda has helped many by providing effective Ayurvedic Treatments for various health conditions and illnesses.

mamta July 29, 2020 at 1:37 AM

Hey this is awesome, you are spreading very informative blog, I am very happy to read this. Keep sharing
Dubai VPS Hosting

Anonymous July 15, 2021 at 12:36 AM

Hey! This blog consist helpful for those people who don't know about" Remove Old Shelevsets". Your content is too good. If anybody want to know the information about USA VPS Hosting
you can ask us for more details and services.

Amit Singh June 17, 2022 at 11:03 PM

That's clever thanks for sharing it.

Best Engineering College in Dehradun

Tramadol 100mg Pink Pill July 20, 2022 at 11:00 PM

Thanks for sharing such a nice information.