Simple-help keeps the screen alive and prevents the system from going to sleep natively.
But, it seems this is only the case when keyboard and mouse control is enabled for the tech.
I usually disable my control of the mouse and keyboard during long processes so the user can continue to work as needed, and so I don’t accidently click something. Problem is, if the user is away the screen locks then I am stuck waiting for them to come back and unlock it.
Reddit to the rescue. https://www.reddit.com/r/PowerShell/comments/rxfgzc/one_line_mouse_jiggler/
I am currently giving this script a try and it seems to work.
[int]$movepx = 20
[int]$sleep = 20
Add-Type -AssemblyName System.Windows.Forms
while (1) {
$prevpos=[System.Windows.Forms.Cursor]::Position
start-sleep -Seconds $sleep
$currpos = [System.Windows.Forms.Cursor]::Position
if ($currpos -eq $prevpos) {
foreach ($xpos in $(($currpos.X + $movepx), ($currpos.X - $movepx), ($currpos.X))){
[System.Windows.Forms.Cursor]::Position=New-Object System.Drawing.Point($xpos, $currpos.Y)
}
}
}