Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the creation time for each file and format it

I can format the time of the files with the following command:

Get-ChildItem Dropbox | Get-Date -format "yyyy-MM-dd hh:mm"

I can get the CreationTime of the files with the following command:

Get-ChildItem Dropbox | Select-Object CreationTime

They blow up when I combine them together. How can I get the creation time in a format I desire?

like image 762
Forethinker Avatar asked Jan 10 '23 03:01

Forethinker


1 Answers

You need to expand the CreationTime property:

Get-ChildItem Dropbox | 
  Select-Object -ExpandProperty CreationTime | 
  Get-Date -f "yyyy-MM-dd hh:mm"
like image 53
DaveShaw Avatar answered Jan 18 '23 07:01

DaveShaw