##In order to move the mouse position you could use something like this:
[system.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | out-null
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(500,500)
##In order to simulate a mouse click you could use something like this:
function Click-MouseButton
{
param(
[string]$Button,
[switch]$help)
$HelpInfo = @'
Function : Click-MouseButton
Purpose : Clicks the Specified Mouse Button
Usage : Click-MouseButton [-Help][-Button x]
where
-Help displays this help
-Button specify the Button You Wish to Click {left, middle, right}
'@
if ($help -or (!$Button))
{
write-host $HelpInfo
return
}
else
{
$signature=@'
[DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
'@
$SendMouseClick = Add-Type -memberDefinition $signature -name "Win32MouseEventNew" -namespace Win32Functions -passThru
if($Button -eq "left")
{
$SendMouseClick::mouse_event(0x00000002, 0, 0, 0, 0);
$SendMouseClick::mouse_event(0x00000004, 0, 0, 0, 0);
}
if($Button -eq "right")
{
$SendMouseClick::mouse_event(0x00000008, 0, 0, 0, 0);
$SendMouseClick::mouse_event(0x00000010, 0, 0, 0, 0);
}
if($Button -eq "middle")
{
$SendMouseClick::mouse_event(0x00000020, 0, 0, 0, 0);
$SendMouseClick::mouse_event(0x00000040, 0, 0, 0, 0);
}
}
}
##To use this function in your script, implement a command like: Click-MouseButton -Button left
##Or you could just use WASP..