Tuesday, January 31, 2006

Monad Dir Highlighting

I'm currently experimenting with the new microsoft shell monad. I always liked the directory en executable highlighting in the linux shell, so I just build a quick script to highlight the directories in an ls query.

$colItems = dir
foreach ($objItem in $colItems)
{
if ($objItem.MshIsContainer )
{ write-host $objItem.Name -foregroundcolor "Blue"}
elseif ( ($objItem.Extension -eq ".exe") -or ($objItem.Extension -eq ".msh") )
{ write-host $objItem.Name -foregroundcolor "Green" }
else
{write-host $objItem.Name}
}

1 comment:

Niels said...

Okay, this was a nice try, but looking at http://mow001.blogspot.com/2006/01/colorized-msh-ls-replacement.html gives a much better implementation.