user1612851
user1612851

Reputation: 1214

AttachTo IE browser using Watin and Powershell

I am having problems using AttachTo with Powershell. I searched, but can't find any Powershell example that uses AttachTo.

This doesn't work: $ie2 = $ie.AttachToIE([watin.core.Find]::ByTitle("Task Selection"))

I guess I am not sure of the syntax. The .NET uses which doesn't work in PS.

Upvotes: 0

Views: 679

Answers (1)

Ansgar Wiechers
Ansgar Wiechers

Reputation: 200293

Try this:

$ie = (New-Object -COM 'Shell.Application').Windows() | ? {
        $_.Name -eq 'Windows Internet Explorer' -and
        $_.LocationName -eq 'Task Selection'
      }

Upvotes: 1

Related Questions