You could redirect the error stream to $null
and evaluate $LastExitCode
to detect an error:
$rhost = 'system2'
winrm id -r:$rhost 2>$null
if ($LastExitCode -eq 0) {
Write-Host "$rhost OK" -ForegroundColor green
} else {
Write-Host "$rhost unavailable" -ForegroundColor red
}