【问题标题】:Is there a way to automatically open the "About" page of a Chromium based browser with PowerShell compatible code?有没有办法使用 PowerShell 兼容代码自动打开基于 Chromium 的浏览器的“关于”页面?
【发布时间】:2022-11-16 15:31:47
【问题描述】:
我只是想编写一些可以将 Chrome 浏览器启动到“关于”页面的代码;或者打开一个带有“关于”页面的选项卡,它将在 PowerShell 中运行。
我尝试了以下方法,它只会导致 chrome 打开一小段时间,然后关闭......
`
Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList '"chrome://about"'
`
这适用于任何 HTTP/S: 位置,但我认为它不喜欢“Chrome:”标签。
... 有任何想法吗?
【问题讨论】:
标签:
powershell
google-chrome
auto-update
about-box
【解决方案1】:
这是因为该着陆页/标签不是合法的 URL。
所以你可以这样做(虽然好吧,你知道的,SendKeys ...)。
Add-Type -AssemblyName System.Windows.Forms
Start-Process -FilePath 'C:Program FilesGoogleChromeApplicationchrome.exe'
Start-Sleep -Milliseconds 300
[System.Windows.Forms.SendKeys]::SendWait('chrome://about{Enter}')