title: Why can't i call Contains method from my array?
body: <p>Arrrg!I am running into what i feel is a dumb issue with a simple script i'm writing in powershell. I am invoking a sql command that is calling a stored proc, with the results i put it a array. The results look something like this: </p>
  
  <pre><code>Status                                       ProcessStartTime                            ProcessEndTime                             
  ------                                       ----------------                            --------------                             
  Expired                                      May 22 2010  8:31PM                         May 22 2010  8:32PM
  </code></pre>
  
  <p>What i'm trying to do is <code>if($s.Contains("Expired"))</code> , report failed. Simple...? :( Problem i'm running into is it looks like Contains method is not being loaded as i get an error like this: </p>
  
  <p><em>Method invocation failed because [System.Object[]] doesn't contain a method named 'Contains'. At line:1 char:12
  + $s.Contains &lt;&lt;&lt;&lt; ("Expired")
      + CategoryInfo          : InvalidOperation: (Contains:String) [], RuntimeException
      + FullyQualifiedErrorId : MethodNotFound</em></p>
  
  <p>So, what can i do to stop powershell from unrolling it to string? Actual ps script below - </p>
  
  <pre><code>$s = @(Invoke-Sqlcmd -Query "USE DB
         GO
         exec Monitor_TEST_ps 'EXPORT_RUN',NULL,20" `
         -ServerInstance testdb002\testdb_002
        )
  
  if ($s.Contains("Expired"))   
  {
      Write-Host "Expired found, FAIL."
  }
  else 
  {
      Write-Host "Not found, OK." 
  }
  </code></pre>