Move-MousePointer
Moves the mouse pointer
param([int]$x = -1, [int]$y = -1)
try {
Add-Type -AssemblyName System.Windows.Forms
if (($x -eq -1) -and ($y -eq -1)) {
$Pos = [System.Windows.Forms.Cursor]::Position
$x = $pos.X + 5
$y = $pos.Y + 5
}
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
exit 0 # success
} catch {
"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}Specifies the x coordinate in pixels
Specifies the y coordinate in pixels