Saturday, June 22, 2013

Position the cursor in Powershell

If you need to position the text cursor anywhere on the screen, this is how you can do it.

Function CoordinateXY
{
   Param([Int] $x, [int] $y)
   $Position = $host.ui.rawui.CursorPosition
   $Position.X = $x
   $Position.Y = $y
   $host.ui.rawui.CursorPosition = $Position
}


Cheers!

No comments:

Post a Comment