Home Forums Programming Powershell email if no new files in last 2 days RE: email if no new files in last 2 days
Gary Varga
SSC Guru
Points: 82166
More actions
July 28, 2014 at 3:15 pm
#1733024
$File = Get-ChildItem $Path | Where { $_.LastWriteTime -ge [datetime]::Now.Addhours(-48) }
If (!$File)
{
# No file changed in 48 hours
}
I hope that helps.
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!