Category:Automation -> PowerShell
While running this script PowerShell will execute ‘Space’ key stroke once every 2 minutes. Useful to keep a session active.
$wshell = New-Object -ComObject wscript.shell;
while($true)
{
$wshell.SendKeys(' ')
sleep 120
}