First of all, when doing a comparison that is equal, you should be using == and not =.

Beyond that, keep in mind that the first one only is true if the result is $null. The second one is true when the result is $null, 0, or $false. The 0 can often cause issues for people who try doing it this way instead of using == $null.