Coloring a particular a Row result with PowerShell
cls $services=Get-Service -name '*sql*' $services| ForEach-Object{ $Know=$_ if($_.Status -eq "Running") { Write-Host $Know.Status, $Know.Name,$Know.DisplayName -foregroundcolor Green -Separator ' : ' } else { Write-Host $Know.Status, $Know.Name, $Know.DisplayName -foregroundcolor Red -Separator ' : ' } }
Comments