When you work with PowerShell, there are times when you need to open a website in a specific browser instead of just any browser or the default one. This is sometimes needed if you need to test how websites look in different browsers or if you need to automate tasks with only a certain browser, not the others.
In this guide, we’ll show you how to use PowerShell commands to open websites in any browser specified by you, whether it’s Chrome, Edge or Firefox, on Windows 11 or Windows 10.
Page Contents
Open a URL in the default browser with PowerShell
Let’s first look at what command to use when you want to open a website with your computer’s default browser. If you don’t need to open a site in a specific browser, this is likely the easiest way. You can use the Start-Process
command in PowerShell.
Start-Process "https://www.windowsdigitals.com"
This command will open the website you choose in whatever browser your computer usually uses.
Related resource: How to Reverse an Array in PowerShell
Open URLs in Google Chrome with PowerShell
If you want to open a website specifically in Google Chrome, you can use a special command like the following.
[System.Diagnostics.Process]::Start("chrome", "https://www.windowsdigitals.com")
Just make sure Chrome is installed and you can find it in your computer’s list of programs (so that PowerShell can actually find it).
Might be useful: How to Set Chrome as Default Browser in Windows 11
Open URLs in Microsoft Edge with PowerShell
For opening a site in Microsoft Edge, you can use a similar command to the one for Chrome. Below is what you need to type.
[System.Diagnostics.Process]::Start("msedge", "https://www.windowsdigitals.com")
Just like with Chrome, make sure Edge is installed on your computer and PowerShell can actually find it.
Pro tip: Run CMD, PowerShell or Regedit as SYSTEM in Windows 11
Open URLs in Mozilla Firefox with PowerShell
To open a website in Mozilla Firefox using PowerShell, you use the same method as for Chrome and Edge.
[System.Diagnostics.Process]::Start("firefox", "https://www.windowsdigitals.com")
Make sure Firefox is installed so that PowerShell knows where to find it on your computer.
Other method to open URLs in a specific browser
If the usual method to open a website in Google Chrome doesn’t work because Chrome isn’t in your computer’s program list, you can use a different command instead.
Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -ArgumentList "http://www.windowsdigitals.com"
In this command, you need to tell PowerShell exactly where to find Chrome on your computer, and then give it the website you want to open. This way, PowerShell knows exactly where to go to start Chrome.
Open a URL in PowerShell with other browsers
If you’re using a browser that’s not Chrome, Edge, or Firefox, like Opera, Brave, Tor, or even Safari, the process is mostly the same. Find where the browser’s program is on your computer and use the Start-Process
command with the -ArgumentList
parameter to tell it which website to open.
What if the browser version is different or if it has a custom path?
Different browser versions
If you have different versions of a browser, like the Beta or Developer editions of Chrome, you need to know exactly where they’re installed. To find where an application is on your computer, you can right-click its shortcut and look at its properties.
Custom install paths
If you’ve put your browser in a spot that’s not the usual place, you’ll need to tell PowerShell exactly where it is. You can write this location directly into your script, or find it through your computer’s settings if you’ve set it up that way.
Create a function to open URL in a specific browser
If you often need to open websites in specific browsers, you can actually make a function in PowerShell that does this for you. The following is an example function for opening a site in Google Chrome.
Function Open-Chrome { Param([string]$url) Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -ArgumentList $url }
You can then call Open-Chrome "http://www.windowsdigitals.com"
to open any website in Chrome whenever you need.
You should also check if the browser you want to use is actually installed before you try to open it. If PowerShell can’t find the program, it should tell you what went wrong in a way that’s easy to understand.