4/05/2008

Useful Powershell Scripts

Remove SVN Bindings

Get-ChildItem -Include .svn -Recurse -Force | ForEach-Object { del $_.FullName -Recurse -Force }

Remove bin and obj dirs

Get-ChildItem -Include obj,bin -Recurse | ForEach-Object { del $_.FullName -Recurse -Force }

Prepend mpl.txt to all *.cs files below the current path

Get-ChildItem -include *.cs -Recurse | ForEach-Object { copy C:\mpl.txt $_.Name; type $_ | out-file $_.Name -append -encoding Ascii; move $_.Name $_.FullName -force }

0 comments: