From what I know, PowerShell doesn\'t seem to have a built-in expression for the so-called ternary operator.
For example, in the C language, which supports the terna
$result = If ($condition) {"true"} Else {"false"}
Everything else is incidental complexity and thus to be avoided.
For use in or as an expression, not just an assignment, wrap it in $(), thus:
$()
write-host $(If ($condition) {"true"} Else {"false"})