Tuesday, July 22, 2014

#19 : Find files more than Modified date of a File

Sometime, we come to a situation where we have to purge some files. The File-Purge has one more trick that it must be greater than LastWriteDate of a file.

Below code might help -

ls | where {$_.LastWriteTime -ge (ls | where { $_.name -eq "somd.flg" } ).LastWriteTime }

No comments:

Post a Comment

#112: How to handle xml document in Powershell?

 In PowerShell, you can handle XML data using various cmdlets and methods provided by the .NET Framework. Here's a basic guide on how to...