Microsoft's Get-Date Doc Comparison Operators Doc $wsh = New-Object -ComObject WScript.Shell Be sure to modify that if you use a different format as it's currently US "MM-dd-yyyy". I'm fairly new to Powershell but I assume it's defaulting to my system date format. I just wanted to leave this here in case someone finds it useful. ![]() To add a simple time limit to run I changed the while condition to compare current time vs target time. However I am not sure this is keeping my system alive so please have a play if you're interested! Over time this would cause the cursor to creep towards the edge of the screen one pixel at a time, so you might want to move it, then, then move it back a pixel. If you want to experiment this with, try the following inside the loop: $Pos = ::Position I've been playing with moving the mouse instead of pressing a key as even the F15 keypress results in some odd artefacts in Linux terminal sessions. You don't need to call it every time it loops. Please put the line "$wsh = New-Object -ComObject WScript.Shell" before the while loop. This StackoverOverflow Question tried the same logic calling, without success, they ended up using Python instead.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |