Open a URL in Firefox via PowerShell?

爱⌒轻易说出口 提交于 2019-12-10 14:55:46

问题


I want the url to be opened in Firefox by Powershell script

To make things a bit difficult, Firefox is not the default browser and it is a portable Firefox version.

Edit:

There seems to be some problem with my portable firefox installation. Even when making it the default browser, it doesn't work properly when invoked by start url.

I rechecked it with a fresh install of portable Firefox 4.0 from here and ittlefoot's solution works fine.


回答1:


Using the website as the first argument should work.

X:\path-to-firefox\firefox.exe "http://website-to-launch.com/yadda"



回答2:


try

[system.Diagnostics.Process]::Start("firefox","your-url")

not sure it'll work on portable version you might have to (replace "firefox" with the path to the portable exe) however, it works even if firefox is not default.



来源:https://stackoverflow.com/questions/5776586/open-a-url-in-firefox-via-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!