问题
I'm using Robocopy's log feature to get file information regardless of folder depth (from Learn-PowerShell).
I was able to get a file's timestamp using /TS
option of Robocopy, but this timestamp is modified date of the file.
I also need to log the created date.
So how can I log created date of file?
And another one, how to log Modified date and Created date of folder too, using Robocopy?
回答1:
if you can find a computer with PowerShell v5 you can install a module called PSAlphaFS .
Install-Module PSAlphaFS
copy the module to your system running powershell 4 and import it.
Import-module PSAlphaFS
then run the following command which is similar to get-childitem
but without the 260 char limitation.
Get-LongChildItem -Path C:\temp -Recurse |
Select-Object Name,FullName,CreationTime,LastWriteTime
来源:https://stackoverflow.com/questions/34429999/command-for-robocopy-to-log-created-date