In Powershell, you can also use a grep like you can do on Linux.
In order to search for a string in a file, you can use the following command:


sls "Searchthisstring" "C:\myfile.log" -ca

If you want to have the output without filename, line number:

sls "Searchthisstring" "C:\myfile.log" -ca | Foreach-Object {$_.Line}

If you want to 'grep' multiple words, you can use the 'pattern' argument:

sls -pattern "Searchthisstring|thesecondword" "C:\myfile.log" -ca | Foreach-Object {$_.Line}

Pin It

Who is Online

We have 26 guests and no members online