I am trying to color the column RAM in red if the value is greater than 100 MB:
Get-Process | Format-Table @{ Label = "PID"; Expression={$_.Id}}, @{ Label = "Name"; Expression={$_.Name}}, @{ Label = "RAM (MB)"; Expression={[System.Math]::Round($_.WS/1MB, 1)}}, @{ Label = "Responding"; Expression={$_.Responding}}

I am trying to use Write-Host -nonewline , but the result is incorrect.
Get-Process | Format-Table @{ Label = "PID"; Expression={$_.Id}}, @{ Label = "Name"; Expression={$_.Name}}, @{ Label = "RAM (MB)"; Expression={write-host -NoNewline $([System.Math]::Round($_.WS/1MB, 1)) -ForegroundColor red}}, @{ Label = "Responding"; Expression={ write-host -NoNewline $_.Responding -fore red}}

colors powershell console
Alban
source share