PowerShell Move Mouse every 10-seconds

Add-Type -AssemblyName System.Windows.Forms
 
while ($true)
{
  $Pos = [System.Windows.Forms.Cursor]::Position
  $x = ($pos.X % 500) + 1
  $y = ($pos.Y % 500) + 1
  [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
  Start-Sleep -Seconds 10
}

Leave a Reply

Your email address will not be published. Required fields are marked *