Skip to content

Instantly share code, notes, and snippets.

@deanbot
Forked from jamesfreeman959/keepawake.ps1
Last active July 19, 2022 16:03
Show Gist options
  • Save deanbot/ac40d31b67ead5f3658093c83add7027 to your computer and use it in GitHub Desktop.
Save deanbot/ac40d31b67ead5f3658093c83add7027 to your computer and use it in GitHub Desktop.
PowerShell script to keep a Windows PC awake
# PowerShell script to keep a Windows PC awake
Write-Host "Keeping PC awake... (send Ctrl+C to quit)"
while (1) {
$wsh = New-Object -ComObject WScript.Shell
$wsh.SendKeys('+{F15}')
Start-Sleep -seconds 59
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment