powershell - 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
解决方案
推荐阅读
- reactjs - React useContext 值没有从提供者传递过来?
- python - 函数返回逗号值
- c# - 下载图像并显示 Xamarin
- php - 如何使用 PHP 从 MySQL 列中正确检索 unsigned bigint?
- ios - 如何将计算器逻辑拆分为自己的类?(使用 Xcode/Swift 11.3.1)
- javascript - Vue.js 中的组件通信无法正确渲染
- c - (第一个 C 程序/Hello World)不断出现语法错误
- python - 使用 pandas 组合列集
- firefox-addon - 如何使图标变成正方形?
- dart - 在命名构造函数中指定动态变量的类型