I am attempting to write a script that will recursively scan a directory, local files with the \'.Error\' extension, then email a group of people with a list of the files. I am
You've got to somehow make the script remember which files it already processed. The best solution would be to move the files you processed to another folder via move-item
in your foreach ($file in $array)
loop.
You can also write them in a document and check the document every time the script runs - but depending on if the filenames are unique or how many of them are written, that might to errors or slow runtime of your script.