dongyikong6207 2017-05-19 02:42
浏览 301
已采纳

文件详细信息:大小,上次修改时间,md5值,路径\文件名

Media archiving. Windows. PowerShell. (or by php in command line?)

Any way I can include the md5 hash value for each file? This script provides file size, last modified time, path\filename; having an md5 value would be useful. (Capability to handle entire disks, 100K+ files/many TBs, 4K video [large] files, etc. with ease (i.e., a clean and robust function].)

The results needs to be written into a .txt file and placed into the current working dir.

Get-ChildItem -Recurse | select Length,LastWriteTime,FullName | Format-Table -Wrap -AutoSize | Out-File filelist.txt
  • 写回答

1条回答 默认 最新

  • dragon202076 2017-05-19 03:07
    关注

    If you're using PowerShell v5 (maybe 4?), you can use get-filehash to compute the hash of each file. Then use that in a computed property in select-object.

    Get-childitem -recurse -file | select-object length,lastwritetime,fullname,@{n="Hash";e={get-filehash -algorithm MD5 -path $_.FullName | Select-object -expandproperty Hash}}
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器