Search found 2 matches

by UnRegistrado
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: 13019

Search string with Get-Content and show x lines before/after result

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
by UnRegistrado
2021-Jul-27, 8:03 am
Forum: Windows CMD Shell
Topic: runas with rundll32 syntax
Replies: 1
Views: 4108

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...