Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Last week I showed you how to automate setting the mouse position in a virtual machine. You can also read the current position of the mouse cursor using this code:
$VMName = "Windows 10 Enterprise"
$VMCS = Get-WmiObject -Namespace root\virtualization\v2 -Class Msvm_ComputerSystem -Filter "ElementName='$($VMName)'"
$mouse = $VMCS.GetRelated("Msvm_SyntheticMouse")
$mouse.HorizontalPosition
$mouse.VerticalPosition
Cheers,
Ben