Skip to content

Instantly share code, notes, and snippets.

@karoltheguy
Last active December 24, 2025 16:14
Show Gist options
  • Select an option

  • Save karoltheguy/856b9999b5b064d0c64c5abd4199ac95 to your computer and use it in GitHub Desktop.

Select an option

Save karoltheguy/856b9999b5b064d0c64c5abd4199ac95 to your computer and use it in GitHub Desktop.
Keep Windows awake and not idling
$wsh = New-Object -ComObject WScript.Shell
while (1) {
$rd = Get-Random -Minimum 57 -Maximum 172
$wsh.SendKeys('+{F15}')
Start-Sleep -Seconds $rd
}
@karoltheguy
Copy link
Copy Markdown
Author

Keeps computer awake using a random amount of sleep in between key strokes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment