I have used select-string to validate strings found on one line, however I need PowerShell to recognise multi-line strings, as well as meeting all three conditions (see below)
Output within .log file that needs to be selected:
Return Value
------------
0
I would want something to validate the following string values (all three to be met to return true)
"Return Value", "------------", " 0"
I have tried this, however this is the equivalent of OR not AND in a filter
| Select-String -pattern "Return Value", "------------", " 0"
Sources: http://ss64.com/ps/select-string.html : http://www.sqlservercentral.com/Forums/Topic1253397-1351-1.aspx
You can use regex with the multiline option:
If you post an exmpale of your log, I can adapt the script more to your needs.