activate 2 Edge windows with powershell

Viewed 73

I'm trying to write a simple script which automatically cycles tabs on 2 different edge windows, I have it working on one window in the code below

while(1 -eq 1){
    $wshell=New-Object -ComObject wscript.shell;
    $wshell.AppActivate('Edge'); # Activate on Edge browser
    Sleep 5; # Interval (in seconds) between switch 
    $wshell.SendKeys('^{PGUP}'); # Ctrl + Page Up keyboard shortcut to switch tab
}

How could I activate the second Edge window?

I have already tried alt-tab ing to the other one with this $wshell.SendKeys('%{TAB}'); but it didnt seem to work

0 Answers
Related