PreventScreensaver (listed) 31.01.2019 14:41:54 (19 lines) [Edit] [Raw] [View]

Init

param($minutes = 60) Add-Type -AssemblyName System.Windows.Forms $host.ui.RawUI.WindowTitle = "Prevent Screensaver"

Main

for ($i = 0; $i -lt $minutes; $i++) { Write-Host "." -NoNewline

Start-Sleep -Milliseconds 59999 #59,999s

$Pos = [System.Windows.Forms.Cursor]::Position
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) + 1) , $Pos.Y)

Start-Sleep -Milliseconds 1 #0,001s

$Pos = [System.Windows.Forms.Cursor]::Position
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point((($Pos.X) - 1) , $Pos.Y)

}