Home POWERSHELL List all files in a folder by .LastWriteTime.Day and export the results into a *.csv file in PowerShell

List all files in a folder by .LastWriteTime.Day and export the results into a *.csv file in PowerShell

by Cengiz Kuskaya

Example :

The script lists all files in the specified folder and its subfolders by descending date and exports the output into a *.csv file.

Get-ChildItem -Path E:\TestFolder\* -Recurse | Where-Object {$_.LastWriteTime.day} | Sort-Object -descending | export-csv ‘C:\TestOutput.csv’ -notypeinformation -delimiter ‘;’

Good luck !