Tuesday, July 14, 2015

How to navigate to an URL in Internet Explorer using powershell?

To navigate to an URL use the New-Object definition as in the following: (in this case http://www.bing.com/news):
PS C:\Users\Jayaram> $ie = New-Object -com InternetExplorer.Application
$ie.visible=$true
$ie.navigate("http://www.bing.com/news")

You get to display the following (contents will be different):


BingNews.png

Can you change the size of the window?

Yes, you can change as shown by adding attributes.


Bing_news4to3PS.png

When you run the above in Windows PowerShell you get to display a different sized window:
 


Bing_news4to3.png

These are supported for the Internet COM Object in PowerShell:

 

No comments: