Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to use PowerShell to find files created in the last 15 min and bigger than 5 KB

$
0
0

Hi! 

I am trying to write to a text file, the files created in the last 15 min and bigger than 5KB

I have created this PowerShell script but it's not working. Can somebody help me with this?

$Notprocessedfiles = Get-ChildItem c:\test | where {$_.Lastwritetime -gt (date).addminutes(-15)}
if ($Notprocessedfiles.lenght -gt 3KB) 
{
$Notprocessedfiles | Out-file c:\test\maybe.txt
}

Thanks!


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>