小编Naz*_*Naz的帖子

如何使用 Powershell 变量打开 Edge?

我尝试了以下方法:

$edge = New-Object -com microsoft-edge.application
$edge.visible = $true
$edge.FullScreen = $true
Run Code Online (Sandbox Code Playgroud)

但我得到错误:

New-Object : Retrieving the COM class factory for component with CLSID 
{00000000-0000-0000-0000-000000000000} failed
due to the following error: 80040154 Class not registered (Exception from 
HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
At line:1 char:9
+ $edge = New-Object -com microsoft-edge.application
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ResourceUnavailable: (:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
Run Code Online (Sandbox Code Playgroud)

我在这里做错了什么吗?

编辑 17/07/2019 - 我已更改为以下内容:

$edge = Start-Process -FilePath ($Env:WinDir + "\explorer.exe") 
-ArgumentList 
"shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge"
$edge.visible = $true
$edge.FullScreen …
Run Code Online (Sandbox Code Playgroud)

windows powershell microsoft-edge

4
推荐指数
2
解决办法
2万
查看次数

标签 统计

microsoft-edge ×1

powershell ×1

windows ×1