title: Method invocation failed because system.string doesn't contain a method named 'WaitForStatus''
body: <p>I am trying to stops some services with a PS script , but the I think the type is incorrect. When the script iterates through the array it returns "method invocation failed because system.string doesn't contain a method named 'WaitForStatus'". I need be sure the services have stopped before running the next script.   </p>
  
  <pre><code>Foreach ($i in $services){
      (get-service  -ComputerName Server1 | Where {$_.name -eq "$i"}).stop()
      $i.WaitForStatus('Stopped')
  }
  
  exit $LASTEXITCODE
  </code></pre>