Using Windows PowerShell to remove obj, bin and ReSharper folders

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.

Leave a Reply

Your email address will not be published. Required fields are marked *