启动 Chrome 的 Powershell 调用打开 Edge 三分之二

标签 powershell

我有一个包含以下行的 powershell 文件:

[system.Diagnostics.Process]::Start("chrome","http://some/path/1")
[system.Diagnostics.Process]::Start("chrome","http://some/path/2")
[system.Diagnostics.Process]::Start("chrome","http://some/path/3")

...每次我运行它时,path1 在 Chrome 中打开,后两个在 Edge 中打开。

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName                                                                                  
-------  ------    -----      -----     ------     --  -- -----------                                                                                  
     40       5      844       3792       0.02  56748   1 chrome                                                                                       
     31       4      684       4020       0.02 106324   1 msedge                                                                                       
     31       4      684       4016       0.02  73624   1 msedge   

这是怎么回事?

最佳答案

您可以将多个 URL 传递给 chrome,试试这个:

[system.Diagnostics.Process]::Start("chrome","http://some/path/1 http://some/path/2 http://some/path/3")

(但这将在同一窗口的新标签页中打开)

关于启动 Chrome 的 Powershell 调用打开 Edge 三分之二,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72562379/

相关文章:

powershell - 通过在 PowerShell 中没有输入的情况下按 enter 来执行命令

windows - Chef::Exceptions::WindowsNotAdmin:由于缺少管理员权限,无法获取安全信息

powershell - 如果我使用-computerName,powershell invoke-command将不起作用

powershell - 将别名添加到Microsoft O365组

powershell - 如何在导出到CSV文件时重命名属性?

powershell - 如何访问 PowerShell ($args) 中的所有参数?

loops - 遍历文件并删除几行不同的文本

windows-7 - 为什么将Powershell 2.0与Powershell 1.0安装在同一位置?

powershell - 无法通过插值评估 Powershell 密码

powershell - PowerShell:将字符串追加到Get-ADUser查询的结果