Help with an Edge Powershell Script

Associate
Joined
13 Sep 2010
Posts
1,000
Location
S.W
Please can someone help me out.

I am trying to produce a powershell script that completes the following stages

-Opens MSEDGE as a maximised window
-Enables Developer Mode Options in the current tab (F12) keystroke
-Completes a bing search in the current tab (for argument sake "https://www.bing.com/search?q=1" )

I have coded up to entering developer mode, but I cannot figure out, or find how to search in the existing tab (that is now in developer mode)

Code:
& "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" -ArguementList --profile-directory="Profile 3"
Sleep 5

$wshell = New-Object -ComObject wscript.shell;

$wshell.AppActivate('Google - Microsoft Edge')

$wshell.SendKeys('{F12}')

Any help is very much appreciated :)
 
Soldato
Joined
24 Sep 2015
Posts
3,673
Code:
Start-Process microsoft-edge:https://www.bing.com/search?q=1 -WindowStyle Maximized
Sleep 5
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Google - Microsoft Edge')
$wshell.SendKeys('{F12}')

I haven't tried it but I think that'll work.
 
Back
Top Bottom