Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Get-Date Question

$
0
0

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.  

Viewing all articles
Browse latest Browse all 6937

Latest Images

Trending Articles



Latest Images