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 found 2 matches
- 2022-Dec-26, 12:23 pm
- Forum: Windows PowerShell
- Topic: Search string with Get-Content and show x lines before/after result
- Replies: 1
- Views: 13075
- 2021-Jul-27, 8:03 am
- Forum: Windows CMD Shell
- Topic: runas with rundll32 syntax
- Replies: 1
- Views: 4133
runas with rundll32 syntax
I need to run this: runas /user:MyDomain\MyAdminUser /savecred "rundll32.exe sysdm.cpl,EditEnvironmentVariables" but the behavior is that variable Windows open but not with my admin desired user´s credential. I used several syntaxs with the runas+rundll32 but I couldn´t get the correct syn...