We have a library of 3500 documents for which we're building metadata. About 1/3 of the documents have BC in the title and I want to flag these. Right now, here's what I have and it works fine:
$htmPath = "c:\ht"
$srcfiles = Get-ChildItem $htmPath -filter "*.htm*"
ForEach ($doc in $srcfiles)
{
$s = $doc.Fullname
if($s.contains("BC")) { $bcflag = 1 } else {$bcflag = 0}
Write-Host "File: " $doc.Fullname " BC Flag: " $bcflag
}
It's just come to my attention that there may be some documents with bc in the title, so I need to add an OR to my condition test. I've been unsuccessful with the word OR...errors out with bad method calls, | as a symbol for or...thinks I'm trying to pipe something, and for some reason, I can't include a regex. I can get it to work if I add a duplicate if statement with bc as a condition, but there has to be a way to provide a list of options rather than a series of statements each looking for a single value.
What is the proper syntax to
a.) Provide a list of conditions to test and/or
b.) use a regex in the above statement