Open tab in existing IE instance

前端 未结 3 1250
醉梦人生
醉梦人生 2020-12-16 18:37
$ie = New-Object -com internetexplorer.application

Everytime i open a new website with this object(ie every time when script runs) it is opened in

3条回答
  •  醉梦人生
    2020-12-16 19:04

    You can use this if Internet Explorer is not your default browser:

    Function Open-IETabs {
        param (
            [string[]]$Url
        )
        begin {
            $Ie = New-Object -ComObject InternetExplorer.Application
        }
        process {
            foreach ($Link in $Url) {
                $Ie.Navigate2($Link, 0x1000)
            }
        }
        end {
            $Ie.Visible = $true
        } 
    }
    

    I found this on PowerShell.com

提交回复
热议问题