Colorize Get-Childitem Output

Tech-Archive recommends: Speed Up your PC by fixing your registry



I'm working on a function that will colorize the get-childitem output
based upon file extension, similar to what can be done with the ls
command in Linux. However, the issue I'm running into is that after
sending the get-childitem object down the pipe, I only get the file
names or directory names returned rather than the full output from the
get-childitem cmdlet. Among the variations I've tried include the
following (no extension checking is being done):

1) get-childitem | foreach-object {write-host -ForegroundColor "yellow"
$_}
2) write-host -ForegroundColor "yellow" $(get-childitem)

It seems that the write-host cmdlet is stripping the object of all
properties except the name property. Can anyone explain how the
write-host command affects an object that is passed to it and/or point
me in the right direction as to how to get the full get-childitem
output in color?

.