2

I read that it was not there before,

but is there any solution to simulate an "ESC" key pressing from a powershell script?

Same as when a human would press the ESC key on the keyboard.

jim7475
  • 43
  • 4

1 Answers1

1

Check out these 2 resources:

How to perform keystroke inside powershell?

https://www.jesusninoc.com/11/05/simulate-key-press-by-user-with-sendkeys-and-powershell/

But in a Nutshell:

$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('title of the application window')
Sleep 1
$wshell.SendKeys("{ESC}")
Judd Davey
  • 349
  • 2
  • 5