Posted on August 4, 2022 by Aemilianus KehlerFilter n Find Contextually from CMD output c:\command > c:\txtfile.txt c:\powershell <PS>c:\Get-Content c:\txtfile.txt | Select-String -Pattern <String your interested in finding> -Context 2,4 Context 2,4 means 2 lines above, and 4 lines below the string pattern found. Super useful trick. Please follow and like us: