windowspowershelldatemodified

Extract "Date Modified" from all files in a directory


I have a large shared directory with a lot of folders with sub-folders etc...These folders and sub-folders contains files.

For all files in this directory, I need to create a text file that writes all files paths [,] data_modified.

Can someone help me to write that as a PowerShell script?

Thx


Solution

  • Get-ChildItem -Path "C:\Temp\" -Recurse | Where-Object {$_.PSIsContainer  -eq 0} | Select-Object FullName, LastWriteTime | Out-File -FilePath "C:\files.txt"
    

    Change the paths listed to your liking and it should work