Search string in log file with powershell

Search string use “or”
cat test.txt | where-object {$_.contains(“CREATE”)-or$_.contains(“date”)}

Search string use “and”
cat test.txt | where-object {$_.contains(“CREATE”)-and$_.contains(“date”)}

Search string and export to a test file
cat test.txt | where-object {$_.contains(“CREATE”)-or$_.contains(“date”)} | out-file test2.txt

Export to a CSV file
Get-Process | Export-Csv c:\scripts\test.csv