Search code examples
powershellautomationkeyboard-shortcutsorchestration

How to pass keyboard shortcut to command prompt using powershell script


enter image description here

I need to enter Ctrl-Y here using PowerShell script, in order to automate this task. please let me know how this can be done.

Any suggestions are welcome.


Solution

  • try something like this:

    [System.Windows.Forms.SendKeys]::SendWait('^y')