Simple PowerShell LastWriteTime compare

前端 未结 7 890
我寻月下人不归
我寻月下人不归 2021-02-12 08:42

I need a PowerShell script that can access a file\'s properties and discover the LastWriteTime property and compare it with the current date and return the date differe

相关标签:
7条回答
  • 2021-02-12 09:04

    Slightly easier - use the new-timespan cmdlet, which creates a time interval from the current time.

    ls | where-object {(new-timespan $_.LastWriteTime).days -ge 1}
    

    shows all files not written to today.

    0 讨论(0)
提交回复
热议问题