...unless the value of $3 could be 0 or if the value of $2 could be 1 .. then you would need if ($3 != $null) and if ($2 == $null)