I have a directory with 3 million subdirs. I want to delete all of the subdirs.
I would like to have a PS one-liner like this:
dir | remove-item | tee output to log?
If there were not so many files, I would just use Windows Explorer, highlight and delete. But bcz there are so many subdirs, the folder won't even open in WE. Right now I am using: "remove-item *" but it does not show me the progress, so I dont know if it is hanging. I tried using dir to pipe the names of the subdirs to a file, and then read the file into a PS variable with get-contents, and then loop through the file names, but it is taking too long. At the rate it is going, it will probably take more than a day to complete. Any suggestions on the best way to rapidly delete these, and monitor the progress? I am thinking that a one-liner would be the most efficient, since there would not need to be any intermediate variables to load.