小编Tho*_*mas的帖子

如何使用PowerShell select-string在文件中查找多个模式?

我想在目录中的文件中搜索多个字符串,但是使用"select-string -pattern"没有帮助.谁能告诉我怎么做?

示例:搜索包含"VendorEnquiry"和"Failed"字样的C:\ Logs中的所有文件,并在上午11:30左右使用Logtime.文件结构可能不同(例如,不同的标签名称等):

... <methodException>VendorEnquiry</methodException> ...
... <logTime>13/10/2010T11:30:04 am</logTime> ...
... <status>Failed</status> ...

... <serviceMethodException>VendorEnquiry</serviceMethodException> ...
... <logTime>13/10/2010</logTime> ...
... <serviceStatus>Failed</serviceStatus> ...
Run Code Online (Sandbox Code Playgroud)

谢谢.

powershell

26
推荐指数
3
解决办法
9万
查看次数

标签 统计

powershell ×1