首页 > 解决方案 > How to change the URL in an Edge tab with Powershell

问题描述

I am using Powershell and MS Edge. This is on a routine where we are changing a web page every minute. However I cannot figure out how to change the address of the current tab to reflect the new address so the routine is creating lots of new tabs.

Currently I am using "Start-Process" to display the URL which creates a new tab every minute. To prevent tab build up every 10 minutes all tabs are closed and we start again. This also has the effect of putting the "Restore Pages" dialog on the screen. Its clunky but it works. The addresses in the variable $Filename are https which open easily in a web browser.

The question is how to display https://www.bing.com then change it to display https://www.google.com without closing the browser or opening a new tab using Powershell.

 $Count++
    if ($Count -ge 10) { 
        Stop-Process -name msedge 
        $Count = 1
     }

    if ($Count -eq 1) {
    Start-Process "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" -ArgumentList $Filename,"--start-fullscreen" }  
    if ($Count -gt 1) {
    Start-Process "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" $Filename 

标签: powershellweburltabsfullscreen

解决方案


推荐阅读