Вопрос

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