Skip to content

Instantly share code, notes, and snippets.

@Azooz2014
Last active September 12, 2022 08:59
Show Gist options
  • Save Azooz2014/93792a16a1a51ca3e94b594ec47b6b77 to your computer and use it in GitHub Desktop.
Save Azooz2014/93792a16a1a51ca3e94b594ec47b6b77 to your computer and use it in GitHub Desktop.
Get Directories names with last write formated date and save it to csv file.
$path = "" # Your Folder Path here.
Get-ChildItem -Directory -Depth 1 $path |
Select-Object @{
name='Fullname'; # Can be replaced with Name if you want just directory name.
expression={$_.FullName}
}, @{
name='LastWriteTime';
expression={($_.LastWriteTime).toShortDateString()}
} | Export-Csv -Path "Output path" -NoTypeInformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment