Simple PowerShell LastWriteTime compare

前端 未结 7 1972
别那么骄傲
别那么骄傲 2021-02-12 08:31

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:15

    Use

    ls | % {(get-date) - $_.LastWriteTime }

    It can work to retrieve the diff. You can replace ls with a single file.

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