2012-10-09

Powershell Scripts for Source Control

The following scripts should help you identify which files you want to remove from your source control engine...

gci c:\bleak -include *.suo, *.user -Recurse -name | out-file ToRemove.txt
gci c:\bleak -include *.user -Recurse -name | out-file ToRemove.txt -append
gci c:\bleak -include bin -Recurse -name | out-file ToRemove.txt -append
gci c:\bleak -include obj -Recurse -name | out-file ToRemove.txt -append
gci c:\bleak -include *.orig -Recurse -name | out-file ToRemove.txt -append

If you really wanted to get fancy, you could then loop through all of the lines and add something like... hg remove .

Get-content ToRemove.txt | foreach-object {add-content remove.ps1 "hg remove $_" }

Happy coding.

Zoidberg away!

No comments: