Regex in Custom Inventory Rule
I am trying to write a custom inventory rule to detect a blank text file on the root c:\ drive. However, the text file will have a different name based on the location of the computer. Here is what I am trying to do FilenamesMatchingRegexExist(C:\,NewComputer.*) . I would ultimately like to have NewComputer(PA|RI)?\.txt as the regex param, but I did the other one for simplicity sake. Unfortunately, neither of these seem to work no matter what I try. Can someone help me out here with what I'm doing wrong?
since you are referencing the root you need 2 \\ otherwise it treats the one as a special chararcter call and tries to include the , in the path name. use FilenamesMatchingRegexExist(C:\\, Newcomputer+.*\.txt)