我正在尝试制作一个 .ps1 程序来自动刷新边缘站点 - 我还希望它定位窗口。我需要它来模拟按 Win+RIGHT 但我找不到 windows 键的代码。
$wshell.SendKeys('{??????}')
我正在尝试制作一个 .ps1 程序来自动刷新边缘站点 - 我还希望它定位窗口。我需要它来模拟按 Win+RIGHT 但我找不到 windows 键的代码。
$wshell.SendKeys('{??????}')
与 Windows 键的 SendKeys 一起使用的键绑定是这样的:
# Activating the Windows Key
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait('^{ESC}')
就个人而言,如果我是你,我会使用Autoit powershell 模块来完成这项任务。如果您下载 zip 文件,您需要将 zip 文件中的目录“install\AutoitX”解压缩到您计算机上的某个位置。当然,请务必先解锁 zip 文件。然后,导入 autoit powershell 模块,您可以使用以下代码发送模拟按下您提到的键:
Initialize-AU3
Send-AU3Key -Key "#{RIGHT}" -Mode 0