#Is there any way to press the tab key in a Powershell Script?
1 messages · Page 1 of 1 (latest)
So you got it?
No
so have you researched wscript.shell or sendkeys?
There's two primary methods: one involves using wscript.shell and sendkeys as @glossy turtle suggested, while the other involves loading the System.Windows.Forms assembly. I suggest researching these two options and determining which is best for your scenario.
Is there any way to press the tab key in a Powershell Script?
https://www.powershellgallery.com/packages/Wasp/2.5.0.0
^ This has an old WindowsInput.dll and you can do stuff like this:
Add-Input -Input "Write-H" | Add-Input -KeyPress "TAB" | Send-Input
And it will literally type Write-H and then press the TAB button
(into the same PowerShell window where you ran it, since you didn't tell Send-Input to send it somewhere specific)
It's a pretty cool feature, if I do say so myself 😉
And you can mix and match keyboard and mouse input ...