Powershell script to list last modified files in x days

Let’s say you want to list of files from directory which are modified in last 2 to 3 days with certain extensions. like I would like to list all php files from directory C:\development modified in last 2 days

following PS command gives me exactly that.

PS> C:
PS> cd development
PS> $dtCompare = (Get-Date).AddDays(-3)
PS> get-childitem –recurse | where-object {$_.lastwritetime -gt $dtCompare -and $_.extension -eq “.php”}


hi there, I am software engineer, working in e-commerce company and passionate about all thing digital. On this blog, I share my experiments with different technology.

Tagged with: ,
Posted in PowerShell
2 comments on “Powershell script to list last modified files in x days
    • Jignesh says:

      hi someone,

      I do blogging for my reference so that I don’t have go to google and find the perfect answer and yes I might have copied some of the answers from stack-overflow.
      I’ll start updating post with reference post when part of post is copied from other source.

      Thanks for raising your concern.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What people say about post?
seo hizmeti on Awesome wordpress ecommerce…

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 39 other followers

%d bloggers like this: