Home Forums Programming Powershell email if no new files in last 2 days RE: email if no new files in last 2 days

  • $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!!!