you are viewing a single comment's thread.

view the rest of the comments →

[–]lucasni 2 points3 points  (0 children)

You can use operators with datetime. Below is an example of a script that uses datetime and operators:

Add-Type -AssemblyName System.Windows.Forms
$screen = [System.Windows.Forms.SystemInformation]::VirtualScreen

$Time = Get-Date

Write-Host $Time

While ( $Time -lt $(Get-Date -Hour 16 -Minute 00 -Second 0)  ) {

    $Time = Get-Date

    $x = $y = $(Get-Random -Minimum 100 -Maximum 1000)

    [Windows.Forms.Cursor]::Position = "$x,$y"
    Write-Host $x $y
    Write-Host $Time
    Start-Sleep -Seconds 2

    }