Powershell script that can log already scanned files and ignore them on next run?

前端 未结 3 854
[愿得一人]
[愿得一人] 2021-01-25 20:01

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

3条回答
  •  盖世英雄少女心
    2021-01-25 20:22

    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.

提交回复
热议问题