Version 3

    File Age Monitor (Wildcard)


    This allows you to check the age of a specific file type and define how many minutes old a file can be.

    Examples of file path:

    • C:\temp\*.txt
    • D:\application\*.xml


    You'll also pass in how many minutes the file can before it goes into alarm. Default minute parameter is set to 60.



    If you want to allow sub directories to be scanned you need to comment out line #15 and uncomment out line #16

    #$FileArray = $(Get-ChildItem $path | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $LastWrite })

    $FileArray = $(Get-ChildItem $path -Recurse | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $LastWrite })