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.

有帮助吗?

解决方案

Try this:

$ie = (New-Object -COM 'Shell.Application').Windows() | ? {
        $_.Name -eq 'Windows Internet Explorer' -and
        $_.LocationName -eq 'Task Selection'
      }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top