通过 Powershell 以隐身/私人模式打开多个浏览器

Dav*_*one 1 powershell multiple-browsers

我想使用隐身/私密模式使用 IE、CH 和 FF 打开单个 URL。

我可以使用此 Powershell 脚本通过 3 个浏览器打开该 url:

Param(
[string] $url
)


[System.Diagnostics.Process]::Start("chrome.exe", $url)      
[System.Diagnostics.Process]::Start("firefox.exe",$url )


$IE=new-object -com internetexplorer.application
$IE.navigate2($url)
$IE.visible=$true
Run Code Online (Sandbox Code Playgroud)

如何以隐身模式打开浏览器?

Mat*_*sen 8

chrome.exe采用--incognito命令行选项:

[System.Diagnostics.Process]::Start("chrome.exe","--incognito $url")
Run Code Online (Sandbox Code Playgroud)

同样,firefox.exe采用-private-window命令行选项:

[System.Diagnostics.Process]::Start("firefox.exe","-private-window $url")
Run Code Online (Sandbox Code Playgroud)

正如 @TToni 在评论中指出的,iexplore.exe等效项是-private

[System.Diagnostics.Process]::Start("iexplore.exe","$url -private")
Run Code Online (Sandbox Code Playgroud)

com对象InternetExplorer.Application不支持 InPrivate 浏览 AFAIK