I am performing keystroke to a application, while performing this, application will become active. This will interrupt my current activity.
Method 1:
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('title of the application window')
Sleep 1
$wshell.SendKeys('~')
Method 2: Importing WASP module and sending key stroke.
$window = Select-Window | Where-Object {$_.Title -like "*ApplicationName*" }
Send-Keys -Keys " " -Window $window
Both the methods will activate the application window and then send keystroke. Is there any way to send key without activating the window ?