google-chrome - 用于启动 Chrome 等的 Powershell 脚本

标签 google-chrome powershell

我需要一个脚本来启动谷歌浏览器,然后发送一个信号让它进入全屏模式(通常通过按 f11 来完成)。

Chrome 安装到默认位置。

我尝试过的一个例子是:

Start-Process -FilePath "C:\Program Files(x86)\Google\Chrome\Application\chrome"

这个简单的字符串甚至不适合我。

最佳答案

有时需要一个临时文件夹来让 Chrome 以这种方式启动,所以在这些情况下这可能会奏效。

$pathToChrome = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
$tempFolder = '--user-data-dir=c:\temp' # pick a temp folder for user data
$startmode = '--start-fullscreen' # '--kiosk' is another option
$startPage = 'https://stackoverflow.com'

Start-Process -FilePath $pathToChrome -ArgumentList $tempFolder, $startmode, $startPage

关于google-chrome - 用于启动 Chrome 等的 Powershell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44335076/

相关文章:

node.js - NPM Nodejs 崩溃并出现 BSOD

javascript - 为 Chrome 扩展程序指定 native 消息传递主机

javascript - 在更改时打开时进行选择刷新 - chrome

powershell - 自提升脚本+执行策略

powershell - 在Powershell中的ForEach-Object中引用目标对象

powershell - PowerShell 中根据版本号排序

javascript - Chrome 扩展程序的 chrome.storage

c# - Chrome 忽略了从 WebAPI Controller 发送的 HttpResponse 的 Content-Disposition header 中建议的扩展

powershell - 如何将多行字符串转换为对象或数组?

powershell - 我如何在带有 powershell 的私有(private)模式下使用 IE 或 IE