PoshCode Logo PowerShell Code Repository

Colorize Subversion SVN (modification of post by jim palmer view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/688"></script>download | new post

Colorize Subversion SVN STAT output.
Here’s a PowerShell function that you can use to make those numerous SVN STAT commands you run every day via the PowerShell CLI a little easier to read by adding colors.

  1. ## SVN STAT colorizer - http://www.overset.com/2008/11/18/colorized-subversion-svn-stat-powershell-function/
  2. function ss () {
  3.         $c = @{ "A"="Magenta"; "D"="Red"; "C"="Yellow"; "G"="Blue"; "M"="Cyan"; "U"="Green"; "?"="DarkGray"; "!"="DarkRed" }
  4.         foreach ( $svno in svn stat ) { 
  5.                 if ( $c.ContainsKey($svno.ToString().SubString(0,1).ToUpper()) ) {
  6.                         write-host $svno -Fore $c.Get_Item($svno.ToString().SubString(0,1).ToUpper()).ToString()
  7.                 } else {
  8.                         write-host $svno
  9.                 }
  10.         }
  11. }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me