Trying to find how many files get added to a directory every hour/day?

I’d like to get some reporting around how many files users are adding to some network directories. It would be great to have it report how many files were added every hour but I would settle for every day. I started with
Get-ChildItem -path -Recurse -file | Measure-Object | %{$_.Count}
Which did return the current number of files in the folder and subfolders. So then I though if I set a scheduled task to run this every hour I can just compare the results to see how many were added but I’m having some trouble doing this in any type of elegant fashion. I’d like to have it write the output of the command to a csv, then the next time the the command runs (next hour) it appends the csv. Then I can just use excel to do the math. I’m just not having much luck with that though. They may also be a totally different, better way, that I’m not tinking of. I’m new to PoSH and this sub so any help is appreciated.

submitted by /u/craftbrewbeerbelly
[link] [comments]

Leave a Reply