title: Testing a collection for null
body: <p>Why is it, when I test a collection for <code>null</code> and put the collection as the first parameter, it returns the collection if it's not <code>null</code>, and if it is <code>null</code> it returns <code>null</code>. </p>
  
  <p>I realised that if I cast it to <code>[bool]</code>, it fixes the problem. But I thought the <code>-eq</code> would output a <code>Bool</code> value without the need for a cast?</p>
  
  <pre><code>$objectArray = @('a','b','c','d')
  
  $objectArray -ne $null
  &lt;#
  a
  b
  c
  d
  #&gt;
  
  [bool]($objectArray -ne $null)
  #True
  
  $objectArray -eq $null
  #Nothing is outputted
  
  [bool]($objectArray -eq $null)
  #False
  
  $null -ne $objectArray
  #True
  
  $null -eq $objectArray
  #False
  </code></pre>
  
  <p>When I test a normal string, I get the expected results as seen below:</p>
  
  <pre><code>$object = 'a'
  
  $object -ne $null
  #True
  
  $object -eq $null
  #False
  
  $null -ne $object
  #True
  
  $null -eq $object
  #False
  </code></pre>