Hi,
I would like to write a script to find from when a folder is empty and/or also would like to check if there is no files written to that folder from past 30 mins.
lastwritetime is not good option to select here as it doesn't give accurate result. Is ther a way we can achieve this.
$test = Get-ChildItem -Path "C:\test" -recurse | where-object {$_.name -eq "New folder"} | where-object {$_.lastwritetime -gt (get-date).AddMinutes(-30)} | where-object {$_.PSIsContainer} | Select-Object {$_.Name}
$test1 = ($test | Measure-Object).Count
$test1