Add-Type -AssemblyName System.Windows.Forms $x = 0 while ($true) { [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $x) $x += 5 Start-Sleep -Milliseconds 200 }