I have a directory that inadvertently had about 1.4 million files generated into it. I want to list just the first, say, 100 items, but without the underlying process trying to read the entire directory contents internally, which causes a very long wait which, at this stage, has been processing for nearly an hour.

Is powershell operation not a system administration issue?
–
Nathan RidleyDec 28 '11 at 14:11

1

It is used by system administrators, however your question sounds like a coding task.Nothing wrong to have it here, but I think you are more likely to have question answered among coders.
–
SergeiDec 28 '11 at 14:15

Fair enough. It's not a coding task, I just want to delete files. I'm using FastCopy now, which seems to be doing the trick.
–
Nathan RidleyDec 28 '11 at 14:30

@Sergei : The last post in that stackoverflow thread implies that you take ALL the content and pipe it through a selection filter. That way, Nathan would have to wait for the 1.4 million file handles to get loaded into memory, just to discard 1.3999 million of them :-)
–
Mathias R. JessenDec 28 '11 at 20:35