PreventScreensaver Alternative (listed) 15.04.2019 07:59:14 (13 lines) [Edit] [Raw] [View]

param($count = 600)

$host.ui.RawUI.WindowTitle = "Prevent Screensaver"

$ps = New-Object -com "Wscript.Shell"

for ($i = 0; $i -lt $count; $i++) { Write-Host "_" -NoNewline $ps.SendKeys("{SCROLLLOCK}") Start-Sleep -Seconds 1 $ps.SendKeys("{SCROLLLOCK}") Start-Sleep -Seconds 299 }