Send Keystrokes
Example:
$wshell = New-Object -ComObject wscript.shell;
$wshell.SendKeys('text')
$wshell.SendKeys(~)
This will type out “text” followed by an Enter keystroke
Breakdown:
$wshell = New-Object -ComObject wscript.shell;
Creates a COM Object with a wscript command and assigns it to the variable $wshell
$wshell.SendKeys([KEYSTROKES])
The Object runs the SendKeys command for what is between (). Use single quotes for ‘text’ or one of the codes for non-displayed keys.
Common Non-Displayed Keys
You can combo these with SHIFT, CTRL, and/or ALT by starting with the keys