Unable to output green/red status to pc's in AD

I manage to get the data from AD successfully but i am unable to colour coordinate the output to green/red in the status field.
Once that is completed i need to send it via email.
If someone can help it will be appreciated

$comps = Get-ADComputer -Filter "Location -like '*Conference Room*'" -Properties name, location
$result = foreach ($comp in $comps) {
    [PSCustomObject]@{
        ComputerName = $comp.Name
        Location = $comp.Location
        Status = Test-Connection -ComputerName $comp.Name -Quiet -Count 1
} 
}

$result

How have you tried to color coordinate them? Your code doesn’t have anything related to colors. Have you searched the forums? Someone asked practically the same question a few days ago.

$comps = Get-ADComputer -Filter "Location -like '*Conference Room*'" -Properties name, location

$result = foreach ($comp in $comps){


    [PSCustomObject]@{
        ComputerName = $comp.Name
        Location = $comp.Location
        Status = Test-Connection -ComputerName $comp.Name -Quiet -Count 1 }
        }

 if ($svc.State -eq 'False' -and $svc.StartMode -eq 'False') { $svccolor = 'red' } `
        elseif ($svc.State -eq 'True') { $svccolor = 'green' } `
        else { $svccolor = '' }

        $props = @{'Service Name' = $svc.Name;
                   'Display Name' = $svc.DisplayName;
                   'Start Mode'= $svc.StartMode;
                   'State' = $svc.State;
                   'Color' = $svccolor}
        New-Object -TypeName PSObject -Property $props
   

        $result

Doug, it was her/him asking this question … Unable to get a nice clear output HELP :frowning: … that’s why I think your question is absolutely legit. :wink:

@uthoma20 There is no easy/simple/magic/built in way to achieve what you’re asking for. Powershell is made for admins not for managers. Admins do not need colors - managers do. :wink: People have been there where you are at the moment and they tried to make it easier for others. But you will have to go the rest of the way yourself. Read the available free books, follow the links we’ve given to you and start coding. That’s how we all do it - it’s called try and error. You might search the PowershellGallery for something helpful or almost fitting and adapt it to your special needs. Sorry, we will not develop a ready to use solution for you.