Monday, January 19, 2009

display data in colors

to list out of all services by limiting to name and their status

PS R:\> get-service
| foreach-object { write-host -f yellow -b red $_.name $_.status }

` -f ` also can be coded as ` -foregroundcolor `.
` -b ` also can be coded as ` -backgroundcolor `

No comments:

Post a Comment