【问题标题】:Powershell command/script to find out all documents based on modified date time?Powershell命令/脚本根据修改的日期时间找出所有文档?
【发布时间】:2016-08-26 18:48:00
【问题描述】:

我不熟悉 powershell,我知道 dir 命令,您可以在其中找到基于修改日期的文档(forfiles /P directory /S /D +08/01/2013)。

但是在 powershell 中,是否有命令可以获取具有指定修改日期的所有文档?假设列出所有在 (02/05/2016) 修改日期的文档

我希望你能帮我解决这个问题。非常感谢您的关注。

【问题讨论】:

    标签: windows powershell directory command


    【解决方案1】:

    使用Get-ChildItem cmdlet 检索所有文件(-Recurse如果需要)。并使用Where-Object cmdlet 根据您想要的属性过滤它们:

    Get-ChildItem -Path "your_directory" -Recurse  | where {$_.LastWriteTime.Date -eq ([datetime]::Parse('02/05/2016'))}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-22
      • 2013-06-07
      • 2023-01-10
      • 2022-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多