[英]Is there a way to automatically open the "About" page of a Chromium based browser with PowerShell compatible code?
I am simply trying to code something that can either launch the Chrome browser to the "about" page;我只是想编写一些可以将 Chrome 浏览器启动到“关于”页面的代码; or open a tab with the "about" page, that will run in PowerShell.
或者打开带有“关于”页面的选项卡,它将在 PowerShell 中运行。
I have tried the following, and it only results in chrome opening for a short second, and then closing...我尝试了以下方法,它只会导致 chrome 打开一小段时间,然后关闭......
` `
Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList '"chrome://about"'
` `
This works with any HTTP/S: location, but I think it doesn't like the 'Chrome:' tag.这适用于任何 HTTP/S: 位置,但我认为它不喜欢“Chrome:”标签。
... Any ideas? ... 有任何想法吗?
It's because that landing page/tab is not a legit URL. So you can do this (though well, you know, SendKeys...).这是因为登录页面/标签不是合法的 URL。所以你可以这样做(虽然好吧,你知道的,SendKeys ...)。
Add-Type -AssemblyName System.Windows.Forms
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe'
Start-Sleep -Milliseconds 300
[System.Windows.Forms.SendKeys]::SendWait('chrome://about{Enter}')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.