I need to search a string in a file, and it show me the string and their x lineas before/after string, I tryed several sintaxis but I don´t know how do it. Could someone help me?
Example:
Get-Content -Path C:\Mi-log.txt | where { $_ -match "text-I-want-to-search" } -tail 5
Search string with Get-Content and show x lines before/after result
-
- Posts: 2
- Joined: 2021-Jul-27, 7:57 am