如何获取目录的真实LastWriteTime?

时间:2016-02-12 13:01:15

标签: windows

目录的LastWriteTime仅在创建新文件时更新, 不是在更新时

PS>mkdir foo

PS>Get-Item ".\foo" | select -ExpandProperty lastwritetime
Friday, February 12, 2016 1:56:18 PM

PS>"hello" > .\foo\hello.txt
PS>Get-Item ".\foo" | select -ExpandProperty lastwritetime
Friday, February 12, 2016 1:56:53 PM

PS>"line 2" >> .\foo\hello.txt
PS>Get-Item ".\foo" | select -ExpandProperty lastwritetime
Friday, February 12, 2016 1:56:53 PM

PS>"a new file" >> .\foo\hello1.txt
PS>Get-Item ".\foo" | select -ExpandProperty lastwritetime
Friday, February 12, 2016 1:57:55 PM

如何获取目录更改的时间?

0 个答案:

没有答案