Skip to content

Instantly share code, notes, and snippets.

@tan14142
Created May 25, 2023 08:49
Show Gist options
  • Save tan14142/804f7b2068b97c4314d21194a4425c30 to your computer and use it in GitHub Desktop.
Save tan14142/804f7b2068b97c4314d21194a4425c30 to your computer and use it in GitHub Desktop.
keep-alive.ps1
Clear-Host
Write-Output "Keep-alive with Scroll Lock..."
$WShell = New-Object -com "Wscript.Shell"
while ($true)
{
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Milliseconds 100
$WShell.sendkeys("{SCROLLLOCK}")
Start-Sleep -Seconds 110
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment