Search
Prevent desktop lock or screensaver with PowerShell
1.
param(
$minutes
= 60)
2.
$myshell
=
New-Object
-com
"Wscript.Shell"
3.
for (
$i
= 0;
$i
-lt
$minutes
;
$i
++) {
4.
Start-Sleep
-Seconds
60
5.
$myshell
.sendkeys(
"."
)
6.
}