Home » How to Open URL in Browser in PowerShell

How to Open URL in Browser in PowerShell

Use the Start-Process cmdlet in PowerShell to open a URL in a browser. The Start-Process command allows you to start a process such as a web browser, by specifying its path and arguments.

To open a URL in a browser, you will need to specify the path to the browser’s executable file and the URL as arguments to the Start-Process command in PowerShell.

The following script opens a URL (https://activedirectorytools.net/) in a Google Chrome browser.

Start-Process chrome.exe "https://activedirectorytools.net/"

In this article, we will discuss how to open a URL in a browser using the Start-Process cmdlet, open a URL in a new tab in Chrome, and open a website in Firefox in a maximized window.

The Start-Process cmdlet can also be used to open a URL in a specific browser, even if that browser is not the default browser. You will need to specify the browser’s executable file and URL.

How to Open URL in Default Browser Using PowerShell

To open a URL in the default browser using PowerShell, use the Start-Process command and specify the argument as the URL name.

Start-Process "https://activedirectorytools.net/"

How to Open a URL in Google Chrome using PowerShell

Use the Start-Process command in PowerShell to open a URL in a new tab in a Chrome browser. The following script opens a URL in a new tab in Chrome.

Start-Process chrome.exe "https://activedirectorytools.net/" 

How to Open a URL in Firefox using PowerShell

You can open a URL in Firefox using the Start-Process cmdlet in PowerShell. To do this, you will need to specify the Firefox browser executable file and the URL.

Start-Process firefox.exe "https://activedirectorytools.net/" -WindowStyle Maximized  

In the above PowerShell script, the Start-Process command opens a URL (https://activedirectorytools.net/) in the Firefox browser.

The -WindowStyle parameter allows you to specify the window style of the process that you are starting, in this case, it opens a URL in Firefox in a maximized window.

How to Open a URL in Microsoft Edge

To open a URL in the Microsoft Edge browser, use the Start-Process cmdlet and specify the Edge executable file and URL as argument.

Start-Process msedge.exe "https://activedirectorytools.net/" 

How to Open a Website in Internet Explorer using PowerShell

The following PowerShell script opens a website in the Internet Explorer browser using the Start-Process cmdlet.

Start-Process iexplore.exe "https://activedirectorytools.net/"

Conclusion

I hope the above article on how to open a URL in a browser such as Chrome, Edge, Firefox, and Internet Explorer using the Start-Process cmdlet in PowerShell is helpful to you.

You can use the Get-Process cmdlet to get the path to the executable file for a specific browser.

You can find more topics about Active Directory tools and PowerShell basics on the ActiveDirectoryTools home page.