Skip to content

Using Windows PowerShell to remove obj, bin and ReSharper folders

by Samuel Moura on October 3rd, 2008

I have been using PowerShell for a couple of weeks now and it has been very useful. One of its uses has been to cleanup my source code from bin, obj and ReSharper folders. If you do not have PowerShell installed on your development machine I urge you to install it, just follow this link.

Here is an example command I regularly use to cleanup my source:

dir .\ -include bin,obj,_resharper* -recurse | foreach($_) { rd $_.fullname –Recurse –Force}

I tend to use the shorter command names, so instead of using Get-ChildItem I use dir and instead of remove-item I use rd, in analogy to cmd commands. Please note that the –Force flag indicates that you do not wish to be prompted each time a folder gets deleted.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DotNetKicks
  • Technorati
  • TwitThis

From → Tools

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS