loading...

PowerShell List Files Changed in the Last 7 Days

twitter logo github logo Originally published at chrisfleischhacker.wordpress.com on ・1 min read

$startingpath=”C:\”

$startingdate=$(Get-Date).AddDays(-7)

Get-Childitem $startingpath -Recurse | where-object {!($_.psiscontainer)} | where { $_.LastWriteTime -gt $startingdate } | foreach { Write-Host “$($_.LastWriteTime) :: $($_.Fullname) ” }

OR

foreach {Write-Output “$($_.LastWriteTime) :: $($_.Fullname) ” >> changedfiles.csv }

twitter logo DISCUSS
Classic DEV Post from Jun 14 '19

FreeCodeCamp violated the rights of Medium authors

Chris Fleischhacker profile image
Extensive I.T. expertise across diverse fields with a demonstrated history of evolving alongside emerging and ever-changing technologies in software development, coding and data security practices.

Signed up yet?

DEV is one of the most important resources in software.

Get Started