Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Conditional formatting in psobject output

$
0
0

Is there an elegant way to conditionally format psobject output to the console? I wrote a script to check if a specific service is running or stopped on a number of computers, and used IF logic and write-host -ForegroundColor to make the computers with the service Running stand out. I’m rewriting the script to output a psobject vs. using Write-Host , but am finding that I’m losing the coloring functionality.


Viewing all articles
Browse latest Browse all 13067

Trending Articles