For each file being processed, its name is checked to satisfy the condition. For example, given the following filter list:
$excludeFiles = @" aaa.bbb ccccc.* ddddd???.exe "@ | SplitAndTrim;
It should exclude file processing if it matches any of the lines. Trying to avoid match/regex because this script should be modified by someone who does not know this, and there are several places where this needs to be implemented.
$excludedFiles and the like are generally defined as a whole line. This allows the end user / operator to embed a bunch of file names directly from the CMD / Powershell window.
Powershell doesn't seem to accept -like against an array, so I can't write like this:
"ddddd000.exe" -like @("aaa.bbb", "ccccc.*", "ddddd???.exe")
Did I miss an option? If this is not supported by Powershell, what is the easiest way to implement it?
source share