# Load the necessary system assemblies to control the mouse Add-Type -AssemblyName System.Windows.Forms Add-Type -AssemblyName System.Drawing Write-Host "The mouse is moving up. Press CTRL + C in this window to stop." while ($true) { # Get the current position of the mouse $currentPos = [System.Windows.Forms.Cursor]::Position # Calculate the new position (Subtracting from Y moves the cursor UP) # We move 1 pixel at a time $newY = $currentPos.Y - 1 # Apply the new position [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($currentPos.X, $newY) # Pause for 50 milliseconds to control the speed # Increase this number to make it slower, decrease to make it faster Start-Sleep -Milliseconds 50 }