相关疑难解决方法(0)

如何发送CTRL或ALT +任何其他密钥?

我有PowerShell脚本,它将打开网页(Selenium)并将焦点设置在"消息"框中.现在,我想模拟Ctrl+ V从剪贴板粘贴我的数据.有没有办法在纯PowerShell中做到这一点?可以在powershell函数中使用的C#代码也很棒.

powershell key

13
推荐指数
1
解决办法
7万
查看次数

如何使用 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万
查看次数

标签 统计

powershell ×2

key ×1

microsoft-edge ×1

windows ×1