]> us-delaporte.pagekite.me Git - dotfiles.git/blob - win/stay_awake.ps1
Merge branch 'main' of github.com:edthedev/dotfiles
[dotfiles.git] / win / stay_awake.ps1
1 param($minutes=90)
2 $wsh = New-Object -ComObject WScript.Shell
3 do{
4 "Staying awake for $minutes minutes"
5 $minutes-=1;
6 # Send Shift+F15
7 $wsh.SendKeys('+{F15}')
8 Start-Sleep -seconds 59
9 }until($minutes -lt 0)
10 # Thank you to http://www.zhornsoftware.co.uk/caffeine/