title: How to test for $null array in PowerShell
body: <p>I'm using an array variable in PowerShell 2.0.  If it does not have a value, it will be $null, which I can test for successfully:</p>
  
  <pre><code>PS C:\&gt; [array]$foo = $null
  PS C:\&gt; $foo -eq $null
  True
  </code></pre>
  
  <p>But when I give it a value, the test for $null does not return anything:</p>
  
  <pre><code>PS C:\&gt; [array]$foo = @("bar")
  PS C:\&gt; $foo -eq $null
  PS C:\&gt;
  </code></pre>
  
  <p>How can "-eq $null" give no results?  It's either $null or it's not.</p>
  
  <p>What is the correct way to determine if an array is populated vs. $null?</p>