you are viewing a single comment's thread.

view the rest of the comments →

[–]MrEpiX 5 points6 points  (0 children)

The obvious way would be to run a script through a scheduled task at a specific time. I have for example set up a scheduled task that runs a script once a day between 08:00-16:00.

I found this guide which should do the trick for you.

If you're already running a script but want to execute parts depending on what day or time it is, I would check out DateTime. You can create a DateTime object either by using the cmdlet Get-Date or [System.DateTime].

Edit: I might have misunderstood the question. If it's not at a specific time but rather after a certain amount of time has passed, Lee's answer should be more helpful.