Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

PowerTip: Use PowerShell to Find Changed Directories

$
0
0

Summary: Use Windows PowerShell to identify directories that changed since a specific date.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find directories that have changed since a specific date?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet and specify only directories. Pipe the results to Where-Object and evaluate the LastWriteTime property (dir is an alias for Get-ChildItem? is an alias for Where-Object).

Windows PowerShell 3.0 syntax:

dir -Directory | ? lastwritetime -gt $([datetime]'4/1/2013')

Windows PowerShell 2.0 syntax:

dir | ? { $_.psiscontainer -AND $_.Lastwritetime -gt $([datetime]'4/1/2013')}


Viewing all articles
Browse latest Browse all 34890

Trending Articles



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