Skip to content

Instantly share code, notes, and snippets.

@rdingwall
Created June 19, 2012 09:25
Show Gist options
  • Save rdingwall/2953197 to your computer and use it in GitHub Desktop.
Save rdingwall/2953197 to your computer and use it in GitHub Desktop.
PowerShell script to strip <author> tags from C# files
# Powershell to recursively strip all <author> XML comments out of *.cs files.
# See 'collective code ownership' for why we do not want to encourage individual
# developers claiming/marking sections of code
# http://jamesshore.com/Agile-Book/collective_code_ownership.html.
#
# (And if for some reason you really want to know who worked on a class, SVN
# blame will give you a MUCH better picture anyway).
dir -recurse -filter *.cs $src | foreach ($_) {
$file = $_.fullname
echo $file
(get-content $file) | where {$_ -notmatch "^.*\///.*\<author\>.*$" } | out-file $file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment