I'm looking for a way to open a list of URLs in all of my browsers ( Firefox, Chrome, and IE ) on Windows using a scriptable shell such as Powershell or Cygwin.
Ideally I should be able to type in a list of URLs as arguments to the command, i.e. `openUrl http://example.net http://example2.net http://example3.com...
I would also need this script to pass authentication info into the http header (encoded usename and password).
With chrome it's not hard.
$chrome = (gi ~\AppData\Local\Google\Chrome\Application\chrome.exe ).FullName
$urls = "stackoverflow.com","slate.com"
$urls | % { & $chrome $_ }
First, how to open URLs in PowerShell. In PowerShell open a URL is very simple, just use start
start http://your.url.com
I think you can simple use foreach
to handle the list of URLs.
Second, pass authentication via URL. There is a standard way for HTTP based authentication. (not HTML form based). You could construct the URL like:
http://username:[email protected]
Again, it only works for HTTP based authentication.
Look at HKCR\http\shell\open\command
how each browser handles urls. Then just use the normal methods to launch the browsers with appropriate urls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With