Powershell最快目录列表 [英] Powershell fastest directory list

查看:55
本文介绍了Powershell最快目录列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道递归目录列表的快速方法吗?我正在尝试通过大约 10tb 的 SAN 并且get-childitem -include"需要几天才能运行......我知道没有办法将它缩短到几分钟,但也许可以通过某种方式将时间缩短到几个小时会很棒.我只需要一个可以排序的列表,不需要文件属性,因为我将使用它在我们的 SAN 上查找某些类型的文件,例如 PST 文件.

Anyone know a fast way to do a recursive directory listing? I am trying to go through a SAN of about 10tb and "get-childitem -include" takes days to run... I know there will be no way to bring it down to minutes but perhaps some way to cut the time to a few hours would be great. I only need a list i can sort through don't need the file properties as I will be using this to find certain types of files on our SAN such as PST files.

如果有人能指出我如何使用 这里 我也应该很好.

If anyone could point me in the direction on how to use the compiled code from HERE I should be good too.

推荐答案

如果它只是您在使用 Filter 参数之后的一个扩展,那么它比 -Include 快得多.我还建议您可以使用 PowerShell 3(get-childitem 有新的 -file 开关),据我记得列出的 UNC 路径性能在其中得到了增强(具有底层 .net 4 支持).

If it's just one extension that you're after use the Filter parameter, it's much faster than -Include. I'd also suggest to use PowerShell 3 is you can (get-childitem has the new -file switch), as far as I remember listing UNC paths performance was enhanced in it (with underlying .net 4 support).

另一种选择是从 cmd 窗口使用 dir 命令,应该非常快.

Another option would be to use the dir command from a cmd window, should be very fast.

这篇关于Powershell最快目录列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆