简体   繁体   English

有没有办法使用 PowerShell 兼容代码自动打开基于 Chromium 的浏览器的“关于”页面?

[英]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.

相关问题 如何通过 PowerShell 打开基于 Chromium 的 Microsoft Edge? - How to open Chromium-based Microsoft Edge via PowerShell? bash/powershell 中有没有一种方法可以根据上下文在命令中自动包含一个单词? - Is there a way in bash/powershell to automatically include a word in a command based on context? 有没有办法在使用 Powershell 的浏览器中打开指定 cookies 的网站? - Is there any way to open a website with specified cookies in a browser using Powershell? PowerShell 随机打开关闭浏览器 - PowerShell Open Close Browser Randomly 如何使用 Powershell 在 Edge Chromium 中设置主页? - How can i set the home page in Edge Chromium with Powershell? 具有自动刷新功能的Web浏览器的PowerShell表单 - PowerShell Form with Web Browser that Automatically Refreshes Powershell中的Open Browser刚刚停止工作 - Open Browser in Powershell just stopped working 在PowerShell中打开代码文件作为文本 - open code file in powershell as text 有没有办法让 powershell 根据用户是否单击打开文件对话框中的取消按钮来结束循环? - Is there a way to get powershell to end a loop based upon if the user clicks the cancel button in an open file dialog? 有没有一种方法可以在目录中自动执行PowerShell? - Is there a way to have a PowerShell be executed automatically within a directory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM