Simple if ($cond) { $expr_true } else { $expr_false} statements can be abbreviated with the ternary operator ($cond ? $expr_t : $expr_f). The ternary operator was introduces with PowerShell 7.
if elseif else
An if, elseif, …, else statement allows to check a series of conditions (cond_1, …, cond_n) and executes the body of the first condition that is true.
If no condition is true, the else body is executed. The else body is optional.