I've been playing around with Get-Date and I'm wondering how to do the following.
I need to get today's date and then in exactly 7 days execute an .EXE. This .EXE is a reboot script so I need my script to reset it's counter after it launches the .EXE so every 7 days the .EXE runs.
I've seen examples like this one. if (((Get-Date) - (Get-ChildItem file.html).LastWriteTime).TotalMinutes -gt 45) {
Write-Host "Old file"
}
But I don't want to use a file unless I have too.