Open tab in existing IE instance
You can use Start-Process
to open the URL. If a browser window is already open, it will open as a tab.
Start-Process 'http://www.microsoft.com'
First you have to attach to the already running Internet Explorer instance:
$ie = (New-Object -ComObject "Shell.Application").Windows() |
Where-Object { $_.Name -eq "Windows Internet Explorer" }
Then you Navigate
to the new URL. Where that URL is opened is controlled via the Flags
parameter:
$ie.Navigate("http://www.google.com/", 2048)
Edit: In case 2 or more IE instances are running (additional tabs count as additional instances as well) the enumeration will return an array, so you have to select a particular instance from the array:
$ie[0].Navigate("http://www.google.com/", 2048)