0121 31 45 374
Qoute Icon

Deleting SVN directories with PowerShell

Tim

I've been re-working our new SVN structures recently as I'm now starting to understand how it works but one of the issues I had was trying to move the files/folders from a previous SVN directory.

PowerShell is great if you understand it (which I'm also learning) so I thought I would share this little script with you. It just loops through the files/folders and removes all those named _svn. I found this script from Wyatt Lyon Preul and he complained about the length of the script, but from what I can tell you can condense that down to:

gci $folder -fil '_svn' -r -fo | ? {$_.psIsContainer} | ri -fo -r

I'm not that great with PowerShell yet but I hope that helps someone :)

WARNING: As ever, incase I'm wrong (it happens!) test that on a folder first that you don't worry about losing!

Liked this post? Got a suggestion? Leave a comment