title: Powershell: Unable to click "Google Search" after entering search string
body: <p>I wrote the following snippet to open Internet explorer and search for a particular string. However i am unable to click the "<strong>Google Search</strong>" button to view the search results.</p>
  
  <pre><code>$IE=new-object -com internetexplorer.application  
  $site= "www.google.com"  
  $IE.navigate2($site)  
  $IE.visible=$true  
  $search_string= "Sachin Tendulkar"  
  while($ie.ReadyState -ne 4) {start-sleep -m 100}  
  $IE.document.getElementById("lst-ib").value= "$search_string"  
  $IE.document.getElementsByTagName("input") | Where-Object { $_.Type -eq "submit" -and $_.name -eq "btnK" } | ForEach-Object { $_.Click() };
  </code></pre>
  
  <p>I have even tried the following snippets to try click the "Google Search" button.</p>
  
  <pre><code>$submitButton = $ie.document.getElementsByTagName("input") 
  Foreach($element in $submitButton )
  {
  
      if($element.type -eq "submit" -and $element.value -eq "Google Search"){
      Write-Host $element[0].click()
      }
  }
  </code></pre>
  
  <p>and the below one method too.</p>
  
  <pre><code>$btn = $ie.Document.getElementsByTagName("input") | Where-Object {$_.Type -eq "submit" -and $_.name -eq "btnK"} 
  $btn.click();
  </code></pre>
  
  <p>I need help getting this done.</p>