Getting file "LastWriteTime"

Welcome Forums General PowerShell Q&A Getting file "LastWriteTime"

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
    Posts
  • #6437

    Member
    Points: 0
    Rank: Member

    by tomstrader at 2012-10-15 12:05:44

    Greetings Everyone:
    First off, thanks for this great resource.

    I have been task to create a script that will run from a scheduled task that looks into a directory for files that are 15 minutes old and older from the current time and date and send an email to a distribution list if any are found.

    I have the email part down, just having a time getting the parameter for the files and then determining if they are older than 15 minutes then trigger the email to the DL.

    Thanks in advance.
    'Tom'

    by JeffH at 2012-10-15 19:50:21

    This will show you the files that have been modified in the last 15 minutes

    dir c:\work | where {$_.lastwritetime -ge (Get-Date).AddMinutes(-15)}

    by tomstrader at 2012-10-15 20:34:18

    Jeffrey,

    Thank you so much.

    Tom

The topic ‘Getting file "LastWriteTime"’ is closed to new replies.