我需要创建一个驱动器及其文件夹、子文件夹和修改日期的“树
列表”。
tree/f
命令效果很好,但我需要添加修改日期。
我该怎么做?
最佳答案
它不会那么漂亮,但是您可以使用带有 Get-ChildItem 的 -Recurse
选项来查找所有这些(此外,您可以从中创建一个对象并拥有更多有趣)。
$Path = Path/To/Directory
Get-ChildItem $Path -Recurse
你的输出看起来像这样:
Directory: C:\Temp Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 5/21/2018 3:13 PM subdir1 -a---- 5/10/2018 2:48 PM 59 script.ps1 Directory: C:\Temp\subdir1 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 5/21/2018 3:13 PM 0 test.txt
关于powershell - 修改日期的 tree/f cmd。 Windows Powershell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50469606/