【发布时间】:2016-10-28 14:16:28
【问题描述】:
我正在尝试在我们的源代码控制文件(1000 个)中查找所有 SQL Server 对象名称(大约 800 个)。当我尝试使用 Select-String 时,它会找到一个字符串,但随后它会停止处理该行上的文件它找到了匹配项。这是我得到的一个小样本。它也应该返回匹配 'was' 的内容。
Use the Select-String cmdlet to process both of the words 'test' and 'was' in the same sentence and all it returns is the matches for 'test'.
('This is a test. How was your test?' | Select-String -Pattern @('test','was') -AllMatches).Matches
Groups : {0}
Success : True
Name : 0
Captures : {0}
Index : 10
Length : 4
Value : test
Groups : {0}
Success : True
Name : 0
Captures : {0}
Index : 29
Length : 4
Value : test
【问题讨论】: