I have a powershell script which works just fine in IE however I need to also have it work in Chrome. $ie = new-object -com "InternetExplorer.Application" Works fine for IE. How do I instantiate the Chrome browser?
Asked
Active
Viewed 7.9k times
26
-
2I do not believe Chrome has provided Com objects to be used in PS. – Austin T French Oct 14 '13 at 15:57
2 Answers
38
You can start a process by name and even pass it a parameter, like this:
Start-Process "chrome.exe" "www.google.com"

Jim
- 1,088
- 9
- 12
-
Note: you will not have the same level of control over Chrome like you do with using the New-Object cmdlet and IE. – Jim Oct 14 '13 at 20:22
-
1This works perfectly. I was looking for a solution that would allow me to open chrome to a specific site as part of configuring the workstation for work and this did the trick. Thanks! – Ashton Sheets Apr 07 '14 at 13:50
-
Did not work for me under RDP remote app, although starting calc, i.e., `Start-Process "calc"` works fine. – Leo Oct 10 '15 at 20:50
-
@Leo, The original question was not asked in the context of RDP. Please reconsider your downvote. – Jim Oct 10 '15 at 21:53
-
@jim, I did not downvote. I just added a comment for others who may encounter this page. – Leo Oct 11 '15 at 12:10
-
@Leo, My mistake. In regards to the powershell not starting Chrome under RDP, what message does it give you? – Jim Oct 11 '15 at 19:18
4
if you are fine with a 3rd party dll you could use Selenium which has also a Chromdriver, that gives you the same kind of control over Chrome as through InternetExplorer.Application COM
There is also a PowerShell wrapper for Selenium available on CodePlex

Dirk
- 666
- 6
- 5