PowerShell script to open multiple websites in same browser on different tabs

Copper Contributor

I need to create a script that will open multiple websites, using IE in separate tabs, and also auto click the ok button on a agreement popup.

I have found the following script that manages to open 2 of the 13 but it errors out and does not auto click the Ok button.

$IE = new-object -ComObject "InternetExplorer.Application"
$urls= gc "C:\Users\myname\Temp\url.txt"
$count=1
foreach ($url in $urls){
if ($count -eq 1){
$IE.navigate($url,1)
}
else{
$IE.navigate($url,2048)
}
$count++
}

 

Any assistance would be greatly appreciated. 

0 Replies